Commit b7b07502 authored by mengqr's avatar mengqr

修改框架token

parent bff5f87c
......@@ -5,7 +5,7 @@ export default {
dev: 'https://test6.douniu8.com/', // 开发路径
// dev: 'https://autumnfish.cn',
// dev: 'http://10.0.0.147:8301',
pro: 'https://autumnfish.cn' // 生产路径
pro: 'https://test6.douniu8.com/' // 生产路径
},
/****** request拦截器==>对请求参数做处理 ******/
......
......@@ -22,15 +22,15 @@ service.interceptors.request.use(config => {
// let token='eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3MjY2NTY2NjUsInN1YiI6IjQ4MjY2NiIsImlhdCI6MTcyNjA1MTg2NX0.obv2AOw311MIF_Wx9ese0IS4BhE3CY3hEy7NFi17VovEc24hpQw-i8_ZaftK6NKd_AY0Q0bfU62I-wEGGiNx_Q'
let token= localStorage.getItem("getToken")
let token='eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3MjY2NTY2NjUsInN1YiI6IjQ4MjY2NiIsImlhdCI6MTcyNjA1MTg2NX0.obv2AOw311MIF_Wx9ese0IS4BhE3CY3hEy7NFi17VovEc24hpQw-i8_ZaftK6NKd_AY0Q0bfU62I-wEGGiNx_Q'
// let token= localStorage.getItem("getToken")
// Bearer eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE3MjY2NTY2NjUsInN1YiI6IjQ4MjY2NiIsImlhdCI6MTcyNjA1MTg2NX0.obv2AOw311MIF_Wx9ese0IS4BhE3CY3hEy7NFi17VovEc24hpQw-i8_ZaftK6NKd_AY0Q0bfU62I-wEGGiNx_Q
config.headers = {
'Content-Type':'application/json' ,//配置请求头
'Authorization': 'Bearer'+token
'Authorization': 'Bearer '+token
}
//如有需要:注意使用token的时候需要引入cookie方法或者用本地localStorage等方法,推荐js-cookie
//const token = getCookie('名称');//这里取token之前,你肯定需要先拿到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