fix: user role (#3278)

This commit is contained in:
shaohuzhang1 2025-06-17 14:47:17 +08:00 committed by GitHub
parent 3c39c508cf
commit 695773df7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View File

@ -224,6 +224,8 @@ def get_role_list(user,
workspace_user_role_mapping in
workspace_user_role_mapping_list] + [user.role], version=version)
else:
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

View File

@ -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,
},

View File

@ -9,8 +9,8 @@ export const routes: Array<RouteRecordRaw> = [
},
// 对话用户登录
{
path: '/user-login/:accessToken',
name: 'user_login',
path: '/login/:accessToken',
name: 'login',
component: () => import('@/views/chat/user-login/index.vue'),
},
// 对话用户登录