diff --git a/src/api/modules/menu.ts b/src/api/modules/menu.ts index b70f4dd..08c082a 100644 --- a/src/api/modules/menu.ts +++ b/src/api/modules/menu.ts @@ -18,7 +18,7 @@ export async function getMenuApi(): Promise { * @param params 菜单表单参数(form-data格式) * @returns Promise */ -export async function addMenuApi(params: MenuFormParams): Promise { +export async function createMenuApi(params: MenuFormParams): Promise { return request.post('/menus/create', params); } diff --git a/src/router/index.ts b/src/router/index.ts index b8c93b3..80ef6de 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -88,7 +88,7 @@ const routes = [ const router = createRouter({ history: createWebHistory(), - routes + routes, }); // 全局前置守卫 diff --git a/src/views/system/menuManagement/index.vue b/src/views/system/menuManagement/index.vue index 24edab4..ab44094 100644 --- a/src/views/system/menuManagement/index.vue +++ b/src/views/system/menuManagement/index.vue @@ -102,7 +102,7 @@ import type { FormInstance, FormRules } from 'element-plus' import { Tools, List, HomeFilled, UserFilled, Platform, BellFilled, GoodsFilled, WarningFilled, Plus } from '@element-plus/icons-vue' -import { getMenuApi, addMenuApi, deleteMenuApi, editMenuApi } from '@/api/modules/menu' +import { getMenuApi, createMenuApi, deleteMenuApi, editMenuApi } from '@/api/modules/menu' import { rules } from './rules' // 定义图标映射表和选择图标选项列表 @@ -214,7 +214,7 @@ const handleSubmitMenu = async () => { try { await menuFormRef.value?.validate() if (dialogType.value === 'add') { - await addMenuApi({ + await createMenuApi({ ...menuForm.value, parent_id: menuForm.value.parentId })