Commit 6c31cb93 by luyt

add:前端跨域问题处理

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