先安装依赖包,然后安装mockjs依赖包,最后运行
cnpm install
cnpm install mockjs
npm run dev
编辑文件 config/index.js
修改 api
upfile
转发配置
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '',
proxyTable: {
'/api': {
target: 'https://mock.boxuegu.com/mock/29',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
},
'/upfile': {
target: 'http://172.17.0.65/system/upfile',
changeOrigin: true,
pathRewrite: {
'^/upfile': ''
}
}
},
后端使用微服务编写,使用SpringBoot + SpringCloud + SpringMVC + SpringData