fix: 修复菜单模块导入和服务接口调整
- 修复 menu.controller.ts 装饰器导入路径 - 调整 menu.service.ts 接口方法名和参数 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
import { Controller, Get, Post, Body, Patch, Delete, Param, UseGuards } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth, ApiOkResponse, ApiCreatedResponse } from '@nestjs/swagger';
|
||||
import {
|
||||
ApiTags,
|
||||
ApiOperation,
|
||||
ApiBearerAuth,
|
||||
ApiOkResponse,
|
||||
ApiCreatedResponse,
|
||||
} from '@nestjs/swagger';
|
||||
|
||||
import { RequirePermission } from '../decorators';
|
||||
import { CreateMenuDto, UpdateMenuDto, MenuResponseDto, MenuTreeNodeDto } from '../dto';
|
||||
import { PermissionGuard } from '../guards';
|
||||
import { MenuService } from '../services';
|
||||
|
||||
import { JwtAuthGuard } from '@/auth/guards/jwt-auth.guard';
|
||||
import { RequirePermission } from '@/permission';
|
||||
|
||||
@ApiTags('菜单管理')
|
||||
@Controller('menus')
|
||||
|
||||
@@ -2,7 +2,6 @@ import type {
|
||||
CreateMenuDto,
|
||||
MenuResponse,
|
||||
MenuTreeNode,
|
||||
PaginatedResponse,
|
||||
UpdateMenuDto,
|
||||
} from '@seclusion/shared';
|
||||
|
||||
@@ -16,16 +15,14 @@ export interface GetMenusParams {
|
||||
}
|
||||
|
||||
export const menuService = {
|
||||
// 获取菜单列表
|
||||
getMenus: (params: GetMenusParams = {}): Promise<PaginatedResponse<MenuResponse>> => {
|
||||
return http.get<PaginatedResponse<MenuResponse>>(API_ENDPOINTS.MENUS, {
|
||||
params,
|
||||
});
|
||||
// 获取菜单树(仅启用的菜单)
|
||||
getMenuTree: (): Promise<MenuTreeNode[]> => {
|
||||
return http.get<MenuTreeNode[]>(API_ENDPOINTS.MENUS);
|
||||
},
|
||||
|
||||
// 获取菜单树
|
||||
getMenuTree: (): Promise<MenuTreeNode[]> => {
|
||||
return http.get<MenuTreeNode[]>(`${API_ENDPOINTS.MENUS}/tree`);
|
||||
// 获取完整菜单树(包含禁用的菜单,用于管理界面)
|
||||
getFullMenuTree: (): Promise<MenuTreeNode[]> => {
|
||||
return http.get<MenuTreeNode[]>(`${API_ENDPOINTS.MENUS}/full`);
|
||||
},
|
||||
|
||||
// 获取单个菜单
|
||||
|
||||
Reference in New Issue
Block a user