Commit bf234785 by hank

bug 修改

parent 6c5bbeab
NODE_ENV='development' NODE_ENV='development'
VUE_APP_BASE_API='http://172.16.4.219:8090' VUE_APP_BASE_API='http://server.bdideal.com'
\ No newline at end of file \ No newline at end of file
import axios from 'axios' import axios from 'axios'
import store from '../store' // import store from '../store'
import { import {
getToken, getToken,
removeToken removeToken
...@@ -17,8 +17,8 @@ const service = axios.create({ ...@@ -17,8 +17,8 @@ const service = axios.create({
// request拦截器 // request拦截器
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
if (store.getters.token) { if (getToken()) {
config.headers['visual-token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 config.headers['visualToken'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
} }
return config return config
}, },
......
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 sign in to comment