Skip to content

Commit

Permalink
modify: 去掉写死测试的数据,改为 api 获取菜单数据
Browse files Browse the repository at this point in the history
  • Loading branch information
kangood committed Feb 24, 2024
1 parent 1f5ab4e commit a157226
Showing 1 changed file with 3 additions and 118 deletions.
121 changes: 3 additions & 118 deletions src/modules/org/services/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { PaginateReturn, QueryHook } from '@/modules/database/types';
import { DictionaryType, PublicOrderType } from '@/modules/system/constants';

import { QueryDictionaryDto } from '@/modules/system/dtos';
import { MenuRepository } from '@/modules/system/repositories';
import { DictionaryService } from '@/modules/system/services';

import { CreateUserDto, LoginUserDto, QueryUserDto, UpdateUserDto, UserEchoDto } from '../dtos';
Expand All @@ -32,6 +33,7 @@ type FindParams = {
export class UserService extends BaseService<UserEntity, UserRepository, FindParams> {
constructor(
protected repository: UserRepository,
protected menuRepository: MenuRepository,
protected dictionaryService: DictionaryService,
protected roleAuthorityService: RoleAuthorityService,
) {
Expand Down Expand Up @@ -124,124 +126,7 @@ export class UserService extends BaseService<UserEntity, UserRepository, FindPar
delete user.userRoles;
// 加入新处理的 roleList
user.roles = role;
user.permissions = [
{
id: '9100714781927703',
parentId: '',
label: 'sys.menu.dashboard',
name: 'Dashboard',
icon: 'ic-analysis',
type: 0,
route: 'dashboard',
order: 1,
children: [
{
id: '8426999229400979',
parentId: '9100714781927703',
label: 'sys.menu.workbench',
name: 'Workbench',
type: 1,
route: 'workbench',
component: '/dashboard/workbench/index.tsx',
},
{
id: '9710971640510357',
parentId: '9100714781927703',
label: 'sys.menu.analysis',
name: 'Analysis',
type: 1,
route: 'analysis',
component: '/dashboard/analysis/index.tsx',
},
],
},
{
id: '0901673425580518',
parentId: '',
label: 'sys.menu.management',
name: 'Management',
icon: 'ic-management',
type: 0,
route: 'management',
order: 2,
children: [
{
id: '2781684678535711',
parentId: '0901673425580518',
label: 'sys.menu.user.index',
name: 'User',
type: 0,
route: 'user',
children: [
{
id: '4754063958766648',
parentId: '2781684678535711',
label: 'sys.menu.user.profile',
name: 'Profile',
type: 1,
route: 'profile',
component: '/management/user/profile/index.tsx',
},
{
id: '2516598794787938',
parentId: '2781684678535711',
label: 'sys.menu.user.account',
name: 'Account',
type: 1,
route: 'account',
component: '/management/user/account/index.tsx',
},
],
},
{
id: '0249937641030250',
parentId: '0901673425580518',
label: 'sys.menu.system.index',
name: 'System',
type: 0,
route: 'system',
children: [
{
id: '1985890042972842',
parentId: '0249937641030250',
label: 'sys.menu.system.organization',
name: 'Organization',
type: 1,
route: 'organization',
component: '/management/system/organization/index.tsx',
},
{
id: '4359580910369984',
parentId: '0249937641030250',
label: 'sys.menu.system.permission',
name: 'Permission',
type: 1,
route: 'permission',
component: '/management/system/permission/index.tsx',
},
{
id: '1689241785490759',
parentId: '0249937641030250',
label: 'sys.menu.system.role',
name: 'Role',
type: 1,
route: 'role',
component: '/management/system/role/index.tsx',
},
{
id: '0157880245365433',
parentId: '0249937641030250',
label: 'sys.menu.system.user',
name: 'User',
type: 1,
route: 'user',
component: '/management/system/user/index.tsx',
},
],
},
],
},
];
user.permissions = await this.menuRepository.findTrees();
// const roleAuthorityList = await this.roleAuthorityService.listRoleAuthorityByRoleIds({
// authorityType: AUTHORITY_TYPE_MENU,
// roleIds: [1],
Expand Down

0 comments on commit a157226

Please sign in to comment.