d9f45fde by zhangmeng

登录提示

1 parent d91a4dd4
...@@ -7,13 +7,14 @@ import aes from '@/utils/aes' ...@@ -7,13 +7,14 @@ import aes from '@/utils/aes'
7 import { loginDance } from '@/apiPc/login.js' 7 import { loginDance } from '@/apiPc/login.js'
8 import { getRemindCount } from '@/api/system/user' 8 import { getRemindCount } from '@/api/system/user'
9 import { ElMessageBox } from 'element-plus' 9 import { ElMessageBox } from 'element-plus'
10 import * as match from '@/apiPc/match'
10 11
11 const useUserStore = defineStore( 12 const useUserStore = defineStore(
12 'user', 13 'user',
13 { 14 {
14 state: () => ({ 15 state: () => ({
15 token: getToken(), 16 token: getToken(),
16 user: null, 17 user: null, // uType 1个人账号,2团体账号,3游客登录
17 group: {}, 18 group: {},
18 name: '', 19 name: '',
19 nickName: '', 20 nickName: '',
...@@ -30,10 +31,10 @@ const useUserStore = defineStore( ...@@ -30,10 +31,10 @@ const useUserStore = defineStore(
30 isExam: '1', // 是否为考点,0:是;1:否, 31 isExam: '1', // 是否为考点,0:是;1:否,
31 genFlag: '', // 是否是自动的协会 32 genFlag: '', // 是否是自动的协会
32 badge: {}, 33 badge: {},
33 reLogin: {show:false,query:{}}, 34 reLogin: { show: false, query: {}},
34 visitor: false, 35 visitor: false,
35 language: 0, 36 language: 0,
36 activeName:"5" 37 activeName: '5'
37 }), 38 }),
38 actions: { 39 actions: {
39 // 登录 40 // 登录
...@@ -106,12 +107,34 @@ const useUserStore = defineStore( ...@@ -106,12 +107,34 @@ const useUserStore = defineStore(
106 this.perId = aes.encrypt(personInfo.perId) 107 this.perId = aes.encrypt(personInfo.perId)
107 this.personInfo = personInfo 108 this.personInfo = personInfo
108 } 109 }
110 if (this.user && this.user.utype == 1) {
111 this.getCheckWDSF()
112 }
113
109 resolve(res.data) 114 resolve(res.data)
110 }).catch(error => { 115 }).catch(error => {
111 reject(error) 116 reject(error)
112 }) 117 })
113 }) 118 })
114 }, 119 },
120 getCheckWDSF() {
121 match.preCheckForPerson({ type: '1' }).then(res => {
122 if (res.data == 0) {
123 const language = localStorage.getItem('language')
124 ElMessageBox.confirm(
125 language == 0
126 ? '您绑定的WDSF会员号已过期,请先到WDSF官网激活您的会员号。'
127 : 'Your bound WDSF Number has expired. Please activate your WDSF Number on the WDSF official website first.'
128 , language == 0 ? '提示' : 'Tips', {
129 type: 'warning',
130 confirmButtonText: language == 0 ? '确定' : 'OK',
131 cancelButtonText: language == 0 ? '取消' : 'Cancel'
132 }
133 )
134 }
135 })
136 },
137
115 // 退出系统 138 // 退出系统
116 logOut() { 139 logOut() {
117 return new Promise((resolve, reject) => { 140 return new Promise((resolve, reject) => {
...@@ -148,9 +171,9 @@ const useUserStore = defineStore( ...@@ -148,9 +171,9 @@ const useUserStore = defineStore(
148 }, 171 },
149 setReLogin(query) { 172 setReLogin(query) {
150 console.log(query) 173 console.log(query)
151 this.reLogin = {show:true,query:query} 174 this.reLogin = { show: true, query: query }
152 setTimeout(() => { 175 setTimeout(() => {
153 this.reLogin = {show:false,query:query} 176 this.reLogin = { show: false, query: query }
154 }, 1000) 177 }, 1000)
155 }, 178 },
156 checkAndLogin() { 179 checkAndLogin() {
...@@ -165,8 +188,8 @@ const useUserStore = defineStore( ...@@ -165,8 +188,8 @@ const useUserStore = defineStore(
165 return true 188 return true
166 } 189 }
167 }, 190 },
168 updataActiveName(v){ 191 updataActiveName(v) {
169 this.activeName=v 192 this.activeName = v
170 } 193 }
171 } 194 }
172 }) 195 })
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!