Browse Source

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

yang yi 10 tháng trước cách đây
mục cha
commit
d0e161bd65
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      ui/yangyi-open-api-platform-ui/src/views/user/login.vue

+ 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('/')
           }