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