Commit 6c31cb93 by luyt

add:前端跨域问题处理

1 parent 55045274
......@@ -7,8 +7,8 @@
import axios from 'axios'
import { message } from "ant-design-vue";
// let url = process.env.NODE_ENV == "development" ? "/api" : "http://glsk-front-node.test.glsx.com.cn"
let url = process.env.NODE_ENV == "development" ? "http://192.168.2.24:7001" : "http://192.168.3.182:7001"
let url = process.env.NODE_ENV == "development" ? "/api" : "http://glsk-front-node.test.glsx.com.cn"
// let url = process.env.NODE_ENV == "development" ? "http://192.168.2.24:7001" : "http://192.168.3.182:7001"
const service = axios.create({
withCredentials: false,
baseURL: url
......
module.exports = {
// devServer: {
// port: 8080, // 端口
// proxy: {
// //配置跨域
// "/api": {
// target: "http://192.168.2.24:7001",
// // ws:true,
// changOrigin: true,
// pathRewrite: {
// "^/api": "/"
// }
// }
// }
// }
devServer: {
port: 8080, // 端口
proxy: {
//配置跨域
"/api": {
target: "http://192.168.2.24:7001",
ws:true,
changOrigin: true,
pathRewrite: {
"^/api": "/"
}
}
}
}
};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!