From 8343ccfe4e9efd738d56055ad3c5223c74fa6291 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 5 Sep 2023 17:12:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/menu.ts | 14 +++++++------- src/router/index.ts | 16 ++++++++++------ src/views/system/menu/index.vue | 10 +++++----- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/api/system/menu.ts b/src/api/system/menu.ts index 4827d770..55f7c0d0 100644 --- a/src/api/system/menu.ts +++ b/src/api/system/menu.ts @@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch'; */ export function listMenu(query?: Record) { return request({ - url: '/system/menu/list', + url: '/menuManage/v1/menus', method: 'get', params: query, }); @@ -20,7 +20,7 @@ export function listMenu(query?: Record) { */ export function getMenu(menuId: string | number) { return request({ - url: `/system/menu/${menuId}`, + url: `/menuManage/v1/menu/${menuId}`, method: 'get', }); } @@ -31,7 +31,7 @@ export function getMenu(menuId: string | number) { */ export function menuTreeSelect() { return request({ - url: '/system/menu/treeSelect', + url: '/menuManage/v1/menus/treeSelect', method: 'get', }); } @@ -43,7 +43,7 @@ export function menuTreeSelect() { */ export function roleMenuTreeSelect(roleId: string | number) { return request({ - url: `/system/menu/roleMenuTreeSelect/${roleId}`, + url: `/menuManage/v1/menu/roleMenuTreeSelect/${roleId}`, method: 'get', }); } @@ -55,7 +55,7 @@ export function roleMenuTreeSelect(roleId: string | number) { */ export function addMenu(data: Record) { return request({ - url: '/system/menu', + url: '/menuManage/v1/menu', method: 'post', data: data, }); @@ -68,7 +68,7 @@ export function addMenu(data: Record) { */ export function updateMenu(data: Record) { return request({ - url: '/system/menu', + url: '/menuManage/v1/menu', method: 'put', data: data, }); @@ -81,7 +81,7 @@ export function updateMenu(data: Record) { */ export function delMenu(menuId: string | number) { return request({ - url: `/system/menu/${menuId}`, + url: `/menuManage/v1/menu/${menuId}`, method: 'delete', }); } diff --git a/src/router/index.ts b/src/router/index.ts index 0915ead7..bd7c74a0 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -37,25 +37,25 @@ const constantRoutes: RouteRecordRaw[] = [ { path: '/index', name: 'Index', - meta: { title: '首页', icon: 'icon-pcduan', cache: true }, + meta: { title: '首页', icon: 'icon-pcduan', hideInMenu: true }, component: () => import('@/views/index.vue'), }, { path: '/dome1', name: 'Dome1', - meta: { title: '示例一', icon: 'icon-ios' }, + meta: { title: '示例一', icon: 'icon-ios', hideInMenu: true }, component: () => import('@/views/dome/dome1.vue'), }, { path: '/dome2', name: 'Dome2', - meta: { title: '示例二', icon: 'icon-anzhuo' }, + meta: { title: '示例二', icon: 'icon-anzhuo', hideInMenu: true }, component: () => import('@/views/dome/dome2.vue'), }, { path: '/dome3', name: 'Dome3', - meta: { title: '示例三', icon: 'icon-qunzhu' }, + meta: { title: '示例三', icon: 'icon-qunzhu', hideInMenu: true }, component: () => import('@/views/dome/dome3.vue'), }, { @@ -64,6 +64,7 @@ const constantRoutes: RouteRecordRaw[] = [ meta: { title: '示例目录', icon: 'icon-zhizuoliucheng', + hideInMenu: true, }, component: BlankLayout, redirect: () => ({ name: 'PageInfo' }), @@ -122,16 +123,18 @@ const constantRoutes: RouteRecordRaw[] = [ title: 'Github-打开新窗', icon: 'icon-github', target: '_blank', + hideInMenu: true, }, component: () => {}, }, { - path: 'https://www.antdv.com/components/comment-cn?sdf=12321&id=12&sdnf', + path: 'https://3x.antdv.com/components/comment-cn?sdf=12321&id=12&sdnf', name: 'SelfAnt Design Vue', meta: { title: 'Antdv-当前窗口', icon: 'icon-morentouxiang', target: '_self', + hideInMenu: true, }, component: LinkLayout, }, @@ -140,9 +143,10 @@ const constantRoutes: RouteRecordRaw[] = [ name: 'Account', meta: { title: '个人中心', + hideInMenu: true, }, component: BlankLayout, - redirect: '/account/profile', + redirect: '/account/settings', children: [ { path: 'profile', diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index 7d29d392..5f580c13 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -275,7 +275,7 @@ function fnModalVisibleByVive(menuId: string | number) { getMenu(menuId).then(res => { modalState.confirmLoading = false; hide(); - if (res.code === 200 && res.data) { + if (res.code === 1 && res.data) { modalState.from = Object.assign(modalState.from, res.data); modalState.title = '菜单信息'; modalState.visibleByView = true; @@ -311,7 +311,7 @@ function fnModalVisibleByEdit( getMenu(menuId).then(res => { modalState.confirmLoading = false; hide(); - if (res.code === 200 && res.data) { + if (res.code === 1 && res.data) { modalState.from = Object.assign(modalState.from, res.data); modalState.title = '修改菜单信息'; modalState.visibleByEdit = true; @@ -349,7 +349,7 @@ function fnModalOk() { message.loading({ content: '请稍等...', key }); menu .then(res => { - if (res.code === 200) { + if (res.code === 1) { message.success({ content: `${modalState.title}成功`, key, @@ -398,7 +398,7 @@ function fnRecordDelete(menuId: string | number) { const key = 'delMenu'; message.loading({ content: '请稍等...', key }); delMenu(menuId).then(res => { - if (res.code === 200) { + if (res.code === 1) { message.success({ content: `删除成功`, key, @@ -422,7 +422,7 @@ function fnGetList() { if (tableState.loading) return; tableState.loading = true; listMenu(toRaw(queryParams)).then(res => { - if (res.code === 200 && Array.isArray(res.data)) { + if (res.code === 1 && Array.isArray(res.data)) { menuListData = JSON.parse(JSON.stringify(res.data)); // 初始上级菜单和展开编号key if (treeDataAll.length <= 0) {