Browse Source

Update loganInfo.tsx

lex 1 year ago
parent
commit
8ac53e4900
1 changed files with 7 additions and 9 deletions
  1. 7 9
      src/components/col-header/modals/loganInfo.tsx

+ 7 - 9
src/components/col-header/modals/loganInfo.tsx

@@ -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'