Commit ee70e377 by 李君

配置调整

1 parent 2f3aea0e
window._serverHost = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? '36.112.68.214:9999' : window.location.host window._serverHost = ['localhost', '192.168.1.174'].includes(window.location.hostname) ? '36.112.68.214:9999' : window.location.host
window._baseUrl = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? 'http://36.112.68.214:9999/btool/' : `https://${window._serverHost}/btool/` window._baseUrl = ['localhost', '192.168.1.174'].includes(window.location.hostname) ? 'http://36.112.68.214:9999/btool/' : `https://${window._serverHost}/btool/`
window._baseImgUrl = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? 'http://36.112.68.214:9999/images/' : `${window.location.origin}/images/` window._baseImgUrl = ['localhost', '192.168.1.174'].includes(window.location.hostname) ? 'http://36.112.68.214:9999/images/' : `${window.location.origin}/images/`
window._socketUrl = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? `wss://${window._serverHost}/` : `wss://${window._serverHost}/` window._socketUrl = ['localhost', '192.168.1.174'].includes(window.location.hostname) ? `wss://${window._serverHost}/` : `wss://${window._serverHost}/`
const log = console.log.bind(console) const log = console.log.bind(console)
...@@ -13,6 +13,8 @@ const axiosInstance = axios.create( ...@@ -13,6 +13,8 @@ const axiosInstance = axios.create(
// 请求拦截器 // 请求拦截器
axiosInstance.interceptors.request.use( axiosInstance.interceptors.request.use(
config => { config => {
// Cookies.set('atoken','90eeca8f-7d7e-4dfa-8d7b-468e033dd048')
config.headers.Authorization = Cookies.get('atoken') config.headers.Authorization = Cookies.get('atoken')
return config return config
...@@ -28,7 +30,10 @@ axiosInstance.interceptors.response.use( ...@@ -28,7 +30,10 @@ axiosInstance.interceptors.response.use(
message: `登录过期,请重新登录`, message: `登录过期,请重新登录`,
type: 'warning' type: 'warning'
}) })
// location.href=window.location.origin // setTimeout(()=>{
// let url = ['localhost', '192.168.1.174'].includes(window.location.hostname) ? 'http://36.112.68.214:33333/' : window.location.origin
// window.location.href=url;
// },300)
return return
} }
return responseData return responseData
......
...@@ -57,9 +57,9 @@ module.exports = { ...@@ -57,9 +57,9 @@ module.exports = {
// 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串 // 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
devServer: { devServer: {
proxy: { proxy: {
'/malls': { '/': {
target: 'https://store.keliuyun.com/report/malls', target: 'http://36.112.68.214:9999/btool/',
// changeOrigin: true changeOrigin: true
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!