Skip to content

Commit

Permalink
去掉手动禁用mock的环境变量
Browse files Browse the repository at this point in the history
因为umi1.3.3已经内置了MOCK=none
  • Loading branch information
xiaohuoni committed May 18, 2018
1 parent 8d07f96 commit 3f914d9
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .umirc.mock.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import antdServer from 'antd-pro-server';
import mockjs from 'mockjs';
import { getRule, postRule } from './mock/rule';
// // 是否禁用代理
const noProxy = process.env.NO_PROXY === 'true';
import antdServer from "antd-pro-server";
import mockjs from "mockjs";
import { getRule, postRule } from "./mock/rule";

//支持扩展
//支持从mock文件夹引入
//支持mockjs
const proxy = {
'GET /api/test': [
"GET /api/test": [
{
code:'success',
message:'成功'
},
code: "success",
message: "成功"
}
],
'GET /api/test/rule': getRule,
'GET /api/test/tags': mockjs.mock({
'list|100': [{ name: '@city', 'value|1-100': 150, 'type|0-2': 1 }],
}),
"GET /api/test/rule": getRule,
"GET /api/test/tags": mockjs.mock({
"list|100": [{ name: "@city", "value|1-100": 150, "type|0-2": 1 }]
})
};
export default (noProxy ? {} : {...proxy,...antdServer});
export default { ...proxy, ...antdServer };

0 comments on commit 3f914d9

Please sign in to comment.