d9f45fde by zhangmeng

登录提示

1 parent d91a4dd4
......@@ -7,13 +7,14 @@ import aes from '@/utils/aes'
import { loginDance } from '@/apiPc/login.js'
import { getRemindCount } from '@/api/system/user'
import { ElMessageBox } from 'element-plus'
import * as match from '@/apiPc/match'
const useUserStore = defineStore(
'user',
{
state: () => ({
token: getToken(),
user: null,
user: null, // uType 1个人账号,2团体账号,3游客登录
group: {},
name: '',
nickName: '',
......@@ -30,10 +31,10 @@ const useUserStore = defineStore(
isExam: '1', // 是否为考点,0:是;1:否,
genFlag: '', // 是否是自动的协会
badge: {},
reLogin: {show:false,query:{}},
reLogin: { show: false, query: {}},
visitor: false,
language: 0,
activeName:"5"
activeName: '5'
}),
actions: {
// 登录
......@@ -106,12 +107,34 @@ const useUserStore = defineStore(
this.perId = aes.encrypt(personInfo.perId)
this.personInfo = personInfo
}
if (this.user && this.user.utype == 1) {
this.getCheckWDSF()
}
resolve(res.data)
}).catch(error => {
reject(error)
})
})
},
getCheckWDSF() {
match.preCheckForPerson({ type: '1' }).then(res => {
if (res.data == 0) {
const language = localStorage.getItem('language')
ElMessageBox.confirm(
language == 0
? '您绑定的WDSF会员号已过期,请先到WDSF官网激活您的会员号。'
: 'Your bound WDSF Number has expired. Please activate your WDSF Number on the WDSF official website first.'
, language == 0 ? '提示' : 'Tips', {
type: 'warning',
confirmButtonText: language == 0 ? '确定' : 'OK',
cancelButtonText: language == 0 ? '取消' : 'Cancel'
}
)
}
})
},
// 退出系统
logOut() {
return new Promise((resolve, reject) => {
......@@ -148,9 +171,9 @@ const useUserStore = defineStore(
},
setReLogin(query) {
console.log(query)
this.reLogin = {show:true,query:query}
this.reLogin = { show: true, query: query }
setTimeout(() => {
this.reLogin = {show:false,query:query}
this.reLogin = { show: false, query: query }
}, 1000)
},
checkAndLogin() {
......@@ -165,8 +188,8 @@ const useUserStore = defineStore(
return true
}
},
updataActiveName(v){
this.activeName=v
updataActiveName(v) {
this.activeName = v
}
}
})
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!