提交 c37c63c9 authored 作者: 龙菲's avatar 龙菲

修改环境变量

上级 8101a51e
......@@ -2,4 +2,4 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = 'http://172.24.100.189:8080'
VUE_APP_BASE_API = '/api'
......@@ -2,5 +2,5 @@
ENV = 'production'
# base api
VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = 'http://222.85.214.245:9066/api'
NODE_ENV = production
# just a flag
ENV = 'staging'
# base api
VUE_APP_BASE_API = '/stage-api'
VUE_APP_BASE_API = 'http://222.85.214.245:9066/api'
......@@ -7,23 +7,18 @@ import store from '@/store'
import {
getToken
} from '@/utils/auth'
console.log('back-process.env', process.env);
// create an axios instance
const service = axios.create({
// baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
baseURL: '/api',
baseURL: process.env.VUE_APP_BASE_API,
timeout: 5000,
// headers: {
// 'Accept': 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;',
// 'Content-Type': 'image/gif'
// }
})
// request interceptor
service.interceptors.request.use(
config => {
// do something before request is sent
if (getToken()) {
// let each request carry token
// ['X-Token'] is a custom headers key
......@@ -55,7 +50,7 @@ service.interceptors.response.use(
response => {
const res = response.data
// console.log('响应拦截res--------',response);
if (response.config.url === '/api/sys/getVerify') {
if (response.config.url.indexOf('sys/getVerify') != -1) {
// debugger
return res
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论