Skip to content

Commit

Permalink
去掉判断
Browse files Browse the repository at this point in the history
  • Loading branch information
FairyEver committed Nov 25, 2018
1 parent 4f6f93a commit dd4f700
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/plugin/axios/index.js
Expand Up @@ -41,13 +41,9 @@ const service = axios.create({
service.interceptors.request.use(
config => {
// 在请求发送之前做一些处理
if (!(/^https:\/\/|http:\/\//.test(config.url))) {
const token = util.cookies.get('token')
if (token && token !== 'undefined') {
// 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改
config.headers['X-Token'] = token
}
}
const token = util.cookies.get('token')
// 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改
config.headers['X-Token'] = token
return config
},
error => {
Expand Down

0 comments on commit dd4f700

Please sign in to comment.