Commit 2fd3e6e7 authored by 周远喜's avatar 周远喜

开放登陆

parent 14364681
......@@ -87,8 +87,8 @@ service.defaults.headers.put['Content-Type'] = 'application/json';
service.interceptors.request.use(
config => {
// 在请求发送之前做一些处理
// const token = util.cookies.get('token');
const token = sessionStorage.getItem('token');
const token = util.cookies.get('token');
// const token = sessionStorage.getItem('token');
if (token) {
// 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改
config.headers['Authorization'] = 'Bearer ' + token;
......
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