因为 ant-design-pro 的 mock 是一个单独的服务,因此没有办法整合到一块儿打包。暂时我是没有找到。git
因此解决方案就是不用 mock 。antd
因为 系统有异步调取,因此一旦有异步调取就会失败,因此也不能有异步。框架
方案以下异步
1.删除路由权限antdesign
2.删除基本框架异步代码fetch
3.删除基本框架权限代码ui
4.添加hash功能spa
5.编译build改成相对路径code
代码以下component
1 config/config.ts
// component: '../layouts/SecurityLayout', // authority: ['admin', 'user'], // authority: ['admin'],
2 src\layouts\BasicLayout.tsx
// useEffect(() => { // if (dispatch) { // dispatch({ // type: 'user/fetchCurrent', // }); // dispatch({ // type: 'settings/getSetting', // }); // } // }, []);
3 src\layouts\BasicLayout.tsx
{/* <Authorized authority={authorized!.authority} noMatch={noMatch}> */} {children} {/* </Authorized> */}
4 config/config.ts export default {
history: 'hash'
5 config/config.ts export default {
publicPath: './',