Commit 887db0d8 authored by xuezj's avatar xuezj

跨域调试

parent e79652bb
...@@ -14,7 +14,7 @@ module.exports = { ...@@ -14,7 +14,7 @@ module.exports = {
}, },
// Various Dev Server settings // Various Dev Server settings
host: '192.168.28.10', // can be overwritten by process.env.HOST host: '0.0.0.0', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true, autoOpenBrowser: true,
errorOverlay: true, errorOverlay: true,
......
// todo: 测试环境部署的时候对xyqb.com进行替换,先改成这样进行测试,上线改回来
const sapi = '//recruit.xyqb.com' const sapi = '//recruit.xyqb.com'
// const sapi = '//api.stantoo.com'
export { export {
sapi sapi
......
...@@ -4,7 +4,7 @@ import {Notice} from 'iview' ...@@ -4,7 +4,7 @@ import {Notice} from 'iview'
import Vue from 'vue' import Vue from 'vue'
var instance = axios.create({}); var instance = axios.create({});
instance.defaults.timeout = 2500; instance.defaults.timeout = 2500;
instance.defaults.withCredentials = true;
// instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; // instance.defaults.headers.common['Authorization'] = AUTH_TOKEN;
instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
...@@ -16,7 +16,6 @@ instance.interceptors.request.use(function (config) { ...@@ -16,7 +16,6 @@ instance.interceptors.request.use(function (config) {
if (!config.headers['Content-Type']) { if (!config.headers['Content-Type']) {
config.headers['Content-Type'] = 'application/x-www-form-urlencoded' config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
} }
config.withCredentials = true;
return config; return config;
}, function (error) { }, function (error) {
// 对请求错误做些什么 // 对请求错误做些什么
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment