|
@@ -154,22 +154,20 @@ export default defineComponent({
|
|
|
: '/api-website/student/queryUserInfo'
|
|
|
const { data } = await request.get(url)
|
|
|
console.log(data, userType)
|
|
|
- return
|
|
|
- if (data.userType.indexOf(userType) != -1) {
|
|
|
+
|
|
|
+ if (data.lockFlag) {
|
|
|
+ // 账号已锁定
|
|
|
+ ElMessage.error(`无法切换,${str}账号异常`)
|
|
|
+ } else {
|
|
|
setAuth(
|
|
|
JSON.stringify({
|
|
|
token,
|
|
|
loginUserType: userType
|
|
|
})
|
|
|
)
|
|
|
- router.push({ path: '/' })
|
|
|
- // router.push({ path: nowPath, query: { ...route.query } })
|
|
|
- setTimeout(() => {
|
|
|
+ router.push({ path: '/' }).then(() => {
|
|
|
window.location.reload()
|
|
|
- }, 500)
|
|
|
- } else {
|
|
|
- // 账号已锁定
|
|
|
- ElMessage.error('无法切换,账号异常')
|
|
|
+ })
|
|
|
}
|
|
|
} catch {
|
|
|
// state.user.status = 'init'
|