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 in
workspace_user_role_mapping_list] + [user.role], version=version) workspace_user_role_mapping_list] + [user.role], version=version)
else: else:
role_list = [user.role]
if user.role == RoleConstants.ADMIN.value.__str__():
role_list = [user.role, get_role_permission(RoleConstants.WORKSPACE_MANAGE, 'default')] role_list = [user.role, get_role_permission(RoleConstants.WORKSPACE_MANAGE, 'default')]
cache.set(key, role_list, version=version) cache.set(key, role_list, version=version)
return role_list return role_list

View File

@ -25,7 +25,7 @@ router.beforeEach(
return return
} }
const { chatUser } = useStore() const { chatUser } = useStore()
const notAuthRouteNameList = ['user_login'] const notAuthRouteNameList = ['login']
if (!notAuthRouteNameList.includes(to.name ? to.name.toString() : '')) { if (!notAuthRouteNameList.includes(to.name ? to.name.toString() : '')) {
if (to.params && to.params.accessToken) { if (to.params && to.params.accessToken) {
chatUser.setAccessToken(to.params.accessToken.toString()) chatUser.setAccessToken(to.params.accessToken.toString())
@ -40,7 +40,7 @@ router.beforeEach(
if (authentication) { if (authentication) {
if (!token) { if (!token) {
next({ next({
name: 'user_login', name: 'login',
params: { params: {
accessToken: to.params.accessToken, accessToken: to.params.accessToken,
}, },

View File

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