⚡ 优化路由权限配置
This commit is contained in:
parent
433ac0b163
commit
54aadb4144
13
mock/menu.js
13
mock/menu.js
|
|
@ -845,6 +845,14 @@ function getFakeGrantTree(req, res) {
|
|||
return res.json(json);
|
||||
}
|
||||
|
||||
function getFakeAuthRoutes(req, res) {
|
||||
const json = { code: 200, success: true, msg: '操作成功' };
|
||||
json.data = {
|
||||
'/form/advanced-form': { authority: ['admin', 'user'] },
|
||||
};
|
||||
return res.json(json);
|
||||
}
|
||||
|
||||
function fakeSuccess(req, res) {
|
||||
const json = { code: 200, success: true, msg: '操作成功' };
|
||||
return res.json(json);
|
||||
|
|
@ -861,8 +869,9 @@ const proxy = {
|
|||
'GET /api/blade-system/menu/list': getFakeList,
|
||||
'GET /api/blade-system/menu/detail': getFakeDetail,
|
||||
'GET /api/blade-system/menu/tree': getFakeTree,
|
||||
'GET /api/blade-system/menu/grantTree': getFakeGrantTree,
|
||||
'GET /api/blade-system/menu/roleTreeKeys': getFakeRoleTreeKeys,
|
||||
'GET /api/blade-system/menu/grant-tree': getFakeGrantTree,
|
||||
'GET /api/blade-system/menu/role-tree-keys': getFakeRoleTreeKeys,
|
||||
'GET /api/blade-system/menu/auth-routes': getFakeAuthRoutes,
|
||||
'POST /api/blade-system/menu/submit': fakeSuccess,
|
||||
'POST /api/blade-system/menu/remove': fakeSuccess,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -83,14 +83,6 @@ function getFakeTree(req, res) {
|
|||
return res.json(json);
|
||||
}
|
||||
|
||||
function getFakeRoutes(req, res) {
|
||||
const json = { code: 200, success: true, msg: '操作成功' };
|
||||
json.data = {
|
||||
'/form/advanced-form': { authority: ['admin', 'user'] },
|
||||
};
|
||||
return res.json(json);
|
||||
}
|
||||
|
||||
function fakeSuccess(req, res) {
|
||||
const json = { code: 200, success: true, msg: '操作成功' };
|
||||
return res.json(json);
|
||||
|
|
@ -100,7 +92,6 @@ const proxy = {
|
|||
'GET /api/blade-system/role/list': getFakeList,
|
||||
'GET /api/blade-system/role/detail': getFakeDetail,
|
||||
'GET /api/blade-system/role/tree': getFakeTree,
|
||||
'GET /api/blade-system/role/auth-routes': getFakeRoutes,
|
||||
'POST /api/blade-system/role/submit': fakeSuccess,
|
||||
'POST /api/blade-system/role/remove': fakeSuccess,
|
||||
'POST /api/blade-system/role/grant': fakeSuccess,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { routesAuthority } from './services/role';
|
||||
import { routesAuthority } from './services/menu';
|
||||
|
||||
export const dva = {
|
||||
config: {
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ export async function tree(params) {
|
|||
}
|
||||
|
||||
export async function grantTree(params) {
|
||||
return request(`/api/blade-system/menu/grantTree?${stringify(params)}`);
|
||||
return request(`/api/blade-system/menu/grant-tree?${stringify(params)}`);
|
||||
}
|
||||
|
||||
export async function roleTreeKeys(params) {
|
||||
return request(`/api/blade-system/menu/roleTreeKeys?${stringify(params)}`);
|
||||
return request(`/api/blade-system/menu/role-tree-keys?${stringify(params)}`);
|
||||
}
|
||||
|
||||
export async function remove(params) {
|
||||
|
|
@ -45,3 +45,7 @@ export async function submit(params) {
|
|||
export async function detail(params) {
|
||||
return request(`/api/blade-system/menu/detail?${stringify(params)}`);
|
||||
}
|
||||
|
||||
export async function routesAuthority() {
|
||||
return request('/api/blade-system/menu/auth-routes');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ export async function tree(params) {
|
|||
return request(`/api/blade-system/role/tree?${stringify(params)}`);
|
||||
}
|
||||
|
||||
export async function routesAuthority() {
|
||||
return request('/api/blade-system/role/auth-routes');
|
||||
}
|
||||
|
||||
export async function grant(params) {
|
||||
return request('/api/blade-system/role/grant', {
|
||||
method: 'POST',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user