yanghao 1 dia atrás
pai
commit
b34dc5cd3d
1 arquivos alterados com 4 adições e 3 exclusões
  1. 4 3
      src/permission.ts

+ 4 - 3
src/permission.ts

@@ -116,14 +116,15 @@ router.beforeEach(async (to, from, next) => {
       }
     }
   } else {
-    if (to.fullPath.includes('sso') && to.fullPath.includes('username')) {
+    if (to.query.username) {
+      await getTenantId()
       const res = await LoginApi.portalLogin({
         username: to.query.username
       })
 
       authUtil.setToken(res)
-      await getTenantId()
-      next({ path: 'index' })
+
+      next({ path: '/' })
     } else if (whiteList.indexOf(to.path) !== -1) {
       const code = to.query.code
       if (code) {