|
|
@@ -8,8 +8,10 @@ import { getProfileAdvancedData } from './mock/profile';
|
|
|
import { getNotices } from './mock/notices';
|
|
|
import { format, delay } from 'roadhog-api-doc';
|
|
|
|
|
|
-// 代码中会兼容本地 service mock 以及部署站点的静态数据
|
|
|
+// 是否禁用代理
|
|
|
+const noProxy = process.env.NO_PROXY === 'true';
|
|
|
|
|
|
+// 代码中会兼容本地 service mock 以及部署站点的静态数据
|
|
|
const proxy = {
|
|
|
// 支持值为 Object 和 Array
|
|
|
'GET /api/currentUser': {
|
|
|
@@ -79,4 +81,4 @@ const proxy = {
|
|
|
'GET /api/notices': getNotices,
|
|
|
};
|
|
|
|
|
|
-export default delay(proxy, 1000);
|
|
|
+export default noProxy ? {} : delay(proxy, 1000);
|