Prechádzať zdrojové kódy

fix:前端项目,修正登陆后不能正确跳转的问题

yang yi 10 mesiacov pred
rodič
commit
d0e161bd65

+ 3 - 1
ui/yangyi-open-api-platform-ui/src/views/user/login.vue

@@ -273,8 +273,10 @@ const handleLogin = async () => {
           ElMessage.success('登录成功!')
           saveUserInfo(res.data.userInfo)
           setToken(res.data.token)
-          if (res.data.userInfo.role === '管理员'){
+          if (res.data.userInfo.userRole === '管理员'){
             router.push('/manage')
+          }else if (res.data.userInfo.userRole === '用户'){
+            router.push('/home')
           }else{
             router.push('/')
           }