mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
fix: 根据角色返回不同数据,权限管理
This commit is contained in:
@@ -42,11 +42,18 @@ export default [
|
||||
{
|
||||
url: "/getAsyncRoutes",
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
code: 0,
|
||||
info: systemRouter,
|
||||
};
|
||||
response: ({ query }) => {
|
||||
if (query.name === "admin") {
|
||||
return {
|
||||
code: 0,
|
||||
info: systemRouter,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
code: 0,
|
||||
info: [],
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
] as MockMethod[];
|
||||
|
||||
26
mock/map.ts
26
mock/map.ts
@@ -1,29 +1,29 @@
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
import { MockMethod } from "vite-plugin-mock";
|
||||
|
||||
// http://mockjs.com/examples.html#Object
|
||||
const mapList = (): any => {
|
||||
const result: any[] = []
|
||||
const result: any[] = [];
|
||||
for (let index = 0; index < 200; index++) {
|
||||
result.push({
|
||||
plateNumber: "豫A@natural(11111, 99999)@character('upper')",
|
||||
driver: '@cname()',
|
||||
driver: "@cname()",
|
||||
"orientation|1-360": 100,
|
||||
"lng|113-114.1-10": 1,
|
||||
"lat|34-35.1-10": 1
|
||||
})
|
||||
"lat|34-35.1-10": 1,
|
||||
});
|
||||
}
|
||||
return result
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export default [
|
||||
{
|
||||
url: '/getMapInfo',
|
||||
method: 'get',
|
||||
url: "/getMapInfo",
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
code: 0,
|
||||
info: mapList()
|
||||
}
|
||||
info: mapList(),
|
||||
};
|
||||
},
|
||||
}
|
||||
] as MockMethod[]
|
||||
},
|
||||
] as MockMethod[];
|
||||
|
||||
Reference in New Issue
Block a user