fix:修改个人中心修改学科的时候不生效的问题;
This commit is contained in:
parent
e1caa441cb
commit
1882fd0dae
|
@ -42,6 +42,7 @@ import useUserStore from '@/store/modules/user'
|
||||||
import {ArrowDown} from '@element-plus/icons-vue'
|
import {ArrowDown} from '@element-plus/icons-vue'
|
||||||
import { onMounted,ref } from 'vue';
|
import { onMounted,ref } from 'vue';
|
||||||
import { listEvaluation } from '@/api/subject/index'
|
import { listEvaluation } from '@/api/subject/index'
|
||||||
|
import {sessionStore} from '@/utils/store'
|
||||||
const userStore = useUserStore().user
|
const userStore = useUserStore().user
|
||||||
const subjectList = ref([])
|
const subjectList = ref([])
|
||||||
// 获取基础的学科
|
// 获取基础的学科
|
||||||
|
@ -58,6 +59,7 @@ const getSubject = () => {
|
||||||
// 选择学段
|
// 选择学段
|
||||||
const handleUserEduStage = (item) => {
|
const handleUserEduStage = (item) => {
|
||||||
userStore.edustage = item
|
userStore.edustage = item
|
||||||
|
sessionStore.set('edustage',item)
|
||||||
if(item === '幼儿园'){
|
if(item === '幼儿园'){
|
||||||
// 默认语文
|
// 默认语文
|
||||||
userStore.edusubject = '语文'
|
userStore.edusubject = '语文'
|
||||||
|
@ -74,6 +76,7 @@ const handleUserEduStage = (item) => {
|
||||||
// 选择学科
|
// 选择学科
|
||||||
const handleUserEduSubject = (item) => {
|
const handleUserEduSubject = (item) => {
|
||||||
userStore.edusubject = item;
|
userStore.edusubject = item;
|
||||||
|
sessionStore.set('edusubject',item)
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSubject()
|
getSubject()
|
||||||
|
|
|
@ -162,7 +162,8 @@ setTimeout(() => {
|
||||||
function submit() {
|
function submit() {
|
||||||
proxy.$refs.userRef.validate((valid) => {
|
proxy.$refs.userRef.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
userStore.user.avatar = userStore.user.avatar
|
userStore.user.edusubject = sessionStore.get('edusubject')
|
||||||
|
userStore.user.edustage = sessionStore.get('edustage')
|
||||||
updateUserInfo(userStore.user).then((response) => {
|
updateUserInfo(userStore.user).then((response) => {
|
||||||
if(response.code == 200){
|
if(response.code == 200){
|
||||||
userStore.login({username:userStore.user.userName,password:userStore.user.plainpwd}).then(() => {
|
userStore.login({username:userStore.user.userName,password:userStore.user.plainpwd}).then(() => {
|
||||||
|
|
Loading…
Reference in New Issue