xj前端项目
https://github.com/gmr1997/xj-ui.git
进入项目目录运行以下命令
npm install
- 前端运行ip及端口,修改文件config/index.js
host: 'localhost', // can be overwritten by process.env.HOST
port: 9090, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
- 后端跨域配置,修改文件config/index.js
proxyTable: {
'/': {
target: 'http://localhost:9091', // 9091为后端部署端口
changeOrigin: true,
pathRewrite: {
'^/': ''
}
}
}
- axios请求默认转发地址,修改src/main.js
axios.defaults.baseURL = 'http://localhost:9090/' // 9090为前端部署端口
npm run dev
http://localhost:9090/#/index