diff --git a/apps/common/auth/handle/impl/user_token.py b/apps/common/auth/handle/impl/user_token.py index 87ef7eae52e..b26fc4842ee 100644 --- a/apps/common/auth/handle/impl/user_token.py +++ b/apps/common/auth/handle/impl/user_token.py @@ -224,7 +224,9 @@ def get_role_list(user, workspace_user_role_mapping in workspace_user_role_mapping_list] + [user.role], version=version) else: - role_list = [user.role, get_role_permission(RoleConstants.WORKSPACE_MANAGE, 'default')] + role_list = [user.role] + if user.role == RoleConstants.ADMIN.value.__str__(): + role_list = [user.role, get_role_permission(RoleConstants.WORKSPACE_MANAGE, 'default')] cache.set(key, role_list, version=version) return role_list return workspace_list diff --git a/ui/src/router/chat/index.ts b/ui/src/router/chat/index.ts index e09a69e8550..ea6ca141da2 100644 --- a/ui/src/router/chat/index.ts +++ b/ui/src/router/chat/index.ts @@ -25,7 +25,7 @@ router.beforeEach( return } const { chatUser } = useStore() - const notAuthRouteNameList = ['user_login'] + const notAuthRouteNameList = ['login'] if (!notAuthRouteNameList.includes(to.name ? to.name.toString() : '')) { if (to.params && to.params.accessToken) { chatUser.setAccessToken(to.params.accessToken.toString()) @@ -40,7 +40,7 @@ router.beforeEach( if (authentication) { if (!token) { next({ - name: 'user_login', + name: 'login', params: { accessToken: to.params.accessToken, }, diff --git a/ui/src/router/chat/routes.ts b/ui/src/router/chat/routes.ts index 3346d49d977..5b635aa610c 100644 --- a/ui/src/router/chat/routes.ts +++ b/ui/src/router/chat/routes.ts @@ -9,8 +9,8 @@ export const routes: Array = [ }, // 对话用户登录 { - path: '/user-login/:accessToken', - name: 'user_login', + path: '/login/:accessToken', + name: 'login', component: () => import('@/views/chat/user-login/index.vue'), }, // 对话用户登录