- 处理未 mock 情况需要处理的 api 数据,暂时后不需要提供这些 api

This commit is contained in:
sin
2019-03-04 12:15:44 +08:00
parent 171cf5b996
commit 78945c61a7
6 changed files with 87 additions and 19 deletions

View File

@@ -1,4 +1,5 @@
import fetch from 'dva/fetch';
// import fetch from 'dva/fetch';
import getAuthRoutesData from './mock-data/authRoutesData';
export const dva = {
config: {
@@ -30,15 +31,18 @@ export function patchRoutes(routes) {
}
export function render(oldRender) {
fetch('/api/auth_routes')
.then(res => res.json())
.then(
ret => {
authRoutes = ret;
oldRender();
},
() => {
oldRender();
}
);
// fetch('/api/auth_routes')
// .then(res => res.json())
// .then(
// ret => {
// authRoutes = ret;
// oldRender();
// },
// () => {
// oldRender();
// }
// );
authRoutes = getAuthRoutesData;
oldRender();
}