vue-admin-beautiful/mock/controller/roleManagement.js
飞木鱼 949ba51fcb 更新
1. 更新dependencies:日常小版本更新
2. 统一mutations命名规范:将setusername修改setUsername,与setPermissions/setAvatar风格一致
3. 整体格式化代码,无内容修改:
> - 删除未引用的import
> - 删除多余空行
> - function间隔添加空行
> - import与逻辑代码间添加空行
> - 优化导入
> - 内联变量
2020-08-06 18:07:16 +08:00

54 lines
1021 B
JavaScript

const totalCount = 2;
const List = [
{
id: "@id",
permission: "admin",
},
{
id: "@id",
permission: "editor",
},
];
export default [
{
url: "/roleManagement/getList",
type: "post",
response(config) {
const { title = "", pageNo = 1, pageSize = 20 } = config.body;
let mockList = List.filter((item) => {
return !(title && item.title.indexOf(title) < 0);
});
const pageList = mockList.filter(
(item, index) =>
index < pageSize * pageNo && index >= pageSize * (pageNo - 1)
);
return {
code: 200,
msg: "success",
totalCount,
data: pageList,
};
},
},
{
url: "/roleManagement/doEdit",
type: "post",
response() {
return {
code: 200,
msg: "模拟保存成功",
};
},
},
{
url: "/roleManagement/doDelete",
type: "post",
response() {
return {
code: 200,
msg: "模拟删除成功",
};
},
},
];