fix: user role (#3278)
This commit is contained in:
parent
3c39c508cf
commit
695773df7d
@ -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
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
@ -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'),
|
||||
},
|
||||
// 对话用户登录
|
||||
|
||||
Loading…
Reference in New Issue
Block a user