fix: 菜单管理调整
This commit is contained in:
@@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
*/
|
||||
export function listMenu(query?: Record<string, any>) {
|
||||
return request({
|
||||
url: '/system/menu/list',
|
||||
url: '/menuManage/v1/menus',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -20,7 +20,7 @@ export function listMenu(query?: Record<string, any>) {
|
||||
*/
|
||||
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<string, any>) {
|
||||
return request({
|
||||
url: '/system/menu',
|
||||
url: '/menuManage/v1/menu',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -68,7 +68,7 @@ export function addMenu(data: Record<string, any>) {
|
||||
*/
|
||||
export function updateMenu(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/system/menu',
|
||||
url: '/menuManage/v1/menu',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -81,7 +81,7 @@ export function updateMenu(data: Record<string, any>) {
|
||||
*/
|
||||
export function delMenu(menuId: string | number) {
|
||||
return request({
|
||||
url: `/system/menu/${menuId}`,
|
||||
url: `/menuManage/v1/menu/${menuId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user