diff --git a/src/utils/request.js b/src/utils/request.js index 74bdf0f..8ee524e 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -7,7 +7,7 @@ const service = axios.create({ // easy-mock服务挂了,暂时不使用了 // baseURL: '', // timeout: 5000 - baseURL: "api", //把原来的项目地址,改成api,解决跨域问题 + baseURL: "managers", //把原来的项目地址,改成api,解决跨域问题 timeout: 30000, }); diff --git a/vue.config.js b/vue.config.js index 040028d..f7f6c53 100644 --- a/vue.config.js +++ b/vue.config.js @@ -29,11 +29,12 @@ module.exports = defineConfig({ proxy: { "/api": { //表示拦截以/api开头的请求路径 - target: "http://47.96.238.157:8093", //阿里云服务器环境 + //target: "http://47.96.238.157:8093", //阿里云服务器环境 //target: "http://180.166.218.222:40080", //dell + target: "http://180.166.218.222:40080", //dell服务器环境 changOrigin: true, //是否开启跨域 pathRewrite: { - "^/api": "", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的 + "^/api": "/api", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的 }, }, },