Compare commits
No commits in common. "c3bd7b31eea8fdeea406b7cf6e81e33d5edc2c07" and "def2bd32da00557cdfd6180159b87cee759f413e" have entirely different histories.
c3bd7b31ee
...
def2bd32da
|
@ -55,7 +55,7 @@ export const useGetSubject = async () =>{
|
||||||
treeData = getTreeData(subjectList[0].id)
|
treeData = getTreeData(subjectList[0].id)
|
||||||
// 设置一个默认的curNode
|
// 设置一个默认的curNode
|
||||||
let curNode
|
let curNode
|
||||||
if(treeData[0].children && treeData[0].children.length){
|
if(treeData[0].children){
|
||||||
curNode = treeData[0].children[0]
|
curNode = treeData[0].children[0]
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<span class="user-name">{{ userStore.user.nickName }}</span>
|
<span class="user-name">{{ userStore.user.nickName }}</span>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
|
|
||||||
<el-dropdown @command="changeSubject" max-height="500">
|
<el-dropdown @command="changeSubject">
|
||||||
<div class="user-subject">{{ userStore.user.edusubject }}
|
<div class="user-subject">{{ userStore.user.edusubject }}
|
||||||
<el-icon class="el-icon--right"><arrow-down />
|
<el-icon class="el-icon--right"><arrow-down />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
@ -178,10 +178,9 @@ const changeSubject = async (command) =>{
|
||||||
curBook: null,
|
curBook: null,
|
||||||
curNode: null,
|
curNode: null,
|
||||||
defaultExpandedKeys: [],
|
defaultExpandedKeys: [],
|
||||||
subjectTree: []
|
|
||||||
}
|
}
|
||||||
sessionStore.set( 'subject', sessionSubject)
|
sessionStore.set( 'subject', sessionSubject)
|
||||||
const { userId, userName, plainpwd } = userStore.user
|
const { userId, userName, phonenumber, plainpwd } = userStore.user
|
||||||
const data = {
|
const data = {
|
||||||
userId,
|
userId,
|
||||||
userName,
|
userName,
|
||||||
|
@ -189,7 +188,7 @@ const changeSubject = async (command) =>{
|
||||||
edusubject: command.edusubject
|
edusubject: command.edusubject
|
||||||
}
|
}
|
||||||
await updateUserInfo(data)
|
await updateUserInfo(data)
|
||||||
await userStore.login({username: userName, password: plainpwd})
|
await userStore.login({username: phonenumber ? phonenumber : userName, password: plainpwd})
|
||||||
await userStore.getInfo()
|
await userStore.getInfo()
|
||||||
router.go()
|
router.go()
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@ import { listEvaluation } from '@/api/subject/index'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import {ElMessage} from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import { clearBookInfo } from '@/utils/ruoyi'
|
import { clearBookInfo } from '@/utils/ruoyi'
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
user: {
|
user: {
|
||||||
|
@ -149,14 +148,7 @@ function submit() {
|
||||||
userStore.login({username:props.user.userName,password:props.user.plainpwd}).then(() => {
|
userStore.login({username:props.user.userName,password:props.user.plainpwd}).then(() => {
|
||||||
userStore.getInfo().then(res => {
|
userStore.getInfo().then(res => {
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
let sessionSubject = {
|
clearBookInfo()
|
||||||
bookList: null,
|
|
||||||
curBook: null,
|
|
||||||
curNode: null,
|
|
||||||
defaultExpandedKeys: [],
|
|
||||||
subjectTree: []
|
|
||||||
}
|
|
||||||
sessionStore.set( 'subject', sessionSubject)
|
|
||||||
ElMessage.success('修改成功')
|
ElMessage.success('修改成功')
|
||||||
}else{
|
}else{
|
||||||
ElMessage.error(response.msg)
|
ElMessage.error(response.msg)
|
||||||
|
|
Loading…
Reference in New Issue