npm install
npm run serve
npm run build
npm run test
npm run lint
devServer: {
proxy: {
"/api": {
target: "https://wechat.sxhuzhen.com/", //对应自己的接口
changeOrigin: true,
ws: true,
pathRewrite: {
"/api": "/"
}
},
"/qyDev": {
target: "https://test.sxhuzhen.com/", //对应自己的接口
changeOrigin: true,
ws: true,
pathRewrite: {
"/qyDev": "/"
}
}
}
}
// 判断是否为开发环境 /qyDev/(测试) /api/ (正式)
// getUrl("dev") 'dev' 发布测试环境 不传值 发布正式环境
const baseUrl =
process.env.BASE_URL +
(process.env.NODE_ENV === "production" ? getUrl("dev") : "/qyDev");