whyczyk
2021-09-29 c4b3e3ab4c9450e490ca7e7ce5b635db3a0498bb
修改axios发包配置
1个文件已修改
4 ■■■■ 已修改文件
src/assets/js/axios.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/axios.js
@@ -11,13 +11,13 @@
}
// 添加请求拦截器
axios.interceptors.request.use(function (config) {
    if(config.asy){
    if (config.asy) {
        if (process.env.NODE_ENV == 'dev') {
            // 跨域请求
            config.baseURL = 'http://localhost:8919/fg';
            config.withCredentials = true; // 保持请求头
        } else {
            config.baseURL = '/fg';
            config.baseURL = `http://${location.hostname}:8919/fg`;
            config.withCredentials = true; // 保持请求头
        }
    }