|
@@ -29,7 +29,7 @@ import { useCurrentUserStore } from '../base/store/use-current-user';
|
|
|
|
|
|
|
|
import { getConfigField } from '../config/index';
|
|
import { getConfigField } from '../config/index';
|
|
|
|
|
|
|
|
-import { hasPermission } from '../utils/permission';
|
|
|
|
|
|
|
+import { hasBtnPermission, hasRoutePermission } from '../utils/permission';
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
|
|
|
|
@@ -64,18 +64,30 @@ function getXiaoshuBackUrl() {
|
|
|
* 系统资源
|
|
* 系统资源
|
|
|
*/
|
|
*/
|
|
|
const sys_resource_list = {
|
|
const sys_resource_list = {
|
|
|
- 'system:menu:conversation': '/chat/qa', // 会话
|
|
|
|
|
- 'system:conversation:qa': '/chat/qa', // 会话进行中
|
|
|
|
|
- 'system:conversation:hisroty': '/chat/history', // 会话,历史记录
|
|
|
|
|
- 'system:conversation:board': '/chat/board', // 会话,智能体大全
|
|
|
|
|
- 'system:menu:intelligent': '/intelligent', // 智能体
|
|
|
|
|
- 'system:menu:knowledge': '/knowledge' // 知识库管理
|
|
|
|
|
|
|
+ // 菜单权限
|
|
|
|
|
+ // 'system:menu:xiaoshu': '/xiaoshu',
|
|
|
|
|
+ 'system:conversation:board': '/chat/board', // 页面:会话,智能体大全
|
|
|
|
|
+ 'system:conversation:hisroty': '/chat/history', // 页面:会话,历史记录
|
|
|
|
|
+
|
|
|
|
|
+ 'system:menu:intelligent': '/intelligent', // 菜单:智能体
|
|
|
|
|
+ 'system:menu:knowledge': '/knowledge', // 菜单:知识库管理
|
|
|
|
|
+ 'system:menu:model': '/model', // 菜单:模型管理
|
|
|
|
|
+ 'system:menu:permission': '/permission', // 菜单:权限管理
|
|
|
|
|
+
|
|
|
|
|
+ 'system:menu:conversation': '/chat/qa', // 菜单:会话
|
|
|
|
|
+ 'system:conversation:qa': '/chat/qa', // 页面:会话进行中
|
|
|
|
|
+
|
|
|
|
|
+ 'system:group': '/permission/group', // 菜单:用户组管理
|
|
|
|
|
+ 'system:dept': '/permission/org', // 菜单:机构管理
|
|
|
|
|
+ 'system:role': '/permission/role', // 菜单:角色管理
|
|
|
|
|
+ 'system:user': '/permission/account', // 菜单:用户管理
|
|
|
|
|
+ 'system:menu': '/permission/resource' // 菜单:资源管理
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
let back_route = ''; // 返回的地址
|
|
let back_route = ''; // 返回的地址
|
|
|
|
|
|
|
|
for (let key in sys_resource_list) {
|
|
for (let key in sys_resource_list) {
|
|
|
- const has_permission = hasPermission(key);
|
|
|
|
|
|
|
+ const has_permission = hasRoutePermission(key);
|
|
|
|
|
|
|
|
if (has_permission) {
|
|
if (has_permission) {
|
|
|
// 有权限
|
|
// 有权限
|