|
@@ -1,5 +1,5 @@
|
|
|
import axios from 'axios'
|
|
import axios from 'axios'
|
|
|
-// import Cookies from 'js-cookie'
|
|
|
|
|
|
|
+import Cookies from 'js-cookie'
|
|
|
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
|
// 创建axios实例
|
|
// 创建axios实例
|
|
|
const service = axios.create({
|
|
const service = axios.create({
|
|
@@ -11,10 +11,7 @@ const service = axios.create({
|
|
|
// request拦截器
|
|
// request拦截器
|
|
|
service.interceptors.request.use(
|
|
service.interceptors.request.use(
|
|
|
(config) => {
|
|
(config) => {
|
|
|
- const token =
|
|
|
|
|
- // 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImExNDZhYTM0LTBkNTYtNDU5My1iOWVkLTdiMDkxZDYwYWM5ZSJ9.SY61O-6bGj8NsPEgKDhIeUO4ywEZFHoUKbbwL-NK68PckviJhIXuKKdD5laNPhCRvDJT5h2aC614SL7GEqOfWw'
|
|
|
|
|
config.headers['Authorization'] = 'Bearer ' + Cookies.get('Admin-Token')
|
|
config.headers['Authorization'] = 'Bearer ' + Cookies.get('Admin-Token')
|
|
|
- config.headers['Authorization'] = 'Bearer ' + token
|
|
|
|
|
return config
|
|
return config
|
|
|
},
|
|
},
|
|
|
(error) => {
|
|
(error) => {
|