1.页面先dispatch,
2.model里面effects, const response = yield call(getDeviceList);
3.api.js里面 :
export async function getDeviceList() {
return request('/api/admin/device/list.jhtml');
}
打印log发现代码执行到 effects,不往下执行reducers了。
config配置了:
proxy: {
'/api': {
target: 'http://localhost:54660/',
changeOrigin: true,
pathRewrite: { '^/api' : '' },
}
},
奇怪的是F12控制台是能接收到后台传来的值
应该是两个请求的缘故,干掉另一个再写就行了