Explorar o código

Merge branch 'dev' of United_Software/k_online_ui into test

Jack Zhou hai 8 meses
pai
achega
acc892ab00

+ 0 - 4
src/views/Login/src/components/ChangePasswordCard.vue

@@ -123,10 +123,6 @@ const checkPassword = () => {
   // 检测长度是否符合要求
   isValidLength.value = pwd.length >= 12 && pwd.length <= 20
 }
-
-onUnmounted(() => {
-  userStore.logout(true)
-})
 </script>
 
 <template>

+ 3 - 3
src/views/Login/src/loginView.vue

@@ -24,6 +24,7 @@ const getQueryParams = (url: string) => {
   }
   return query
 }
+// 从旧系统使用Token登录
 const handleTokenRedirect = () => {
   if (route.query.token && route.query.uname) {
     const obj: any = getQueryParams(route.fullPath)
@@ -210,9 +211,9 @@ const handleResult = (res: any) => {
         }
       })
     }
+    localStorage.setItem('user_type', res.data.user_info.user_type)
     userStore.setUserInfo(res.data?.user_info || {})
     router.push('/')
-    localStorage.setItem('showTrainingCardAfterLogin', 'true')
   } else if (res.code === 400) {
     const { data } = res
     if (data.msg === 'passwordExpires') {
@@ -232,7 +233,7 @@ const handleResult = (res: any) => {
   }
 }
 
-// 验证结束后调用登录接口
+// 验证结束后调用登录接口(账号密码登录)
 const handleLoginAfterVerify = () => {
   $api
     .login({
@@ -244,7 +245,6 @@ const handleLoginAfterVerify = () => {
       if (res.code === 200) {
         if (isRememerPwd.value) {
           saveCredentials()
-          localStorage.setItem('user_type', res.data.user_info.user_type)
         } else {
           clearCredentials()
         }