|
|
@ -4,7 +4,7 @@ import promise from 'es6-promise' |
|
|
import axios from 'axios' |
|
|
import axios from 'axios' |
|
|
import qs from 'qs' |
|
|
import qs from 'qs' |
|
|
import store from '@/store/index' |
|
|
import store from '@/store/index' |
|
|
import router from '../router' |
|
|
|
|
|
|
|
|
import router from '../router' |
|
|
// import localStorage from '../storage/localStorage'
|
|
|
// import localStorage from '../storage/localStorage'
|
|
|
import Cookie from 'js-cookie' |
|
|
import Cookie from 'js-cookie' |
|
|
promise.polyfill() |
|
|
promise.polyfill() |
|
|
@ -30,7 +30,7 @@ service.interceptors.request.use(config => { |
|
|
// if (localStorage.get('token')) {
|
|
|
// if (localStorage.get('token')) {
|
|
|
// config.headers['x-auth-token'] = localStorage.get('token')
|
|
|
// config.headers['x-auth-token'] = localStorage.get('token')
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Cookie.get('token')) { |
|
|
if (Cookie.get('token')) { |
|
|
config.headers['Authorization'] = Cookie.get('token') |
|
|
config.headers['Authorization'] = Cookie.get('token') |
|
|
} |
|
|
} |
|
|
@ -40,7 +40,7 @@ service.interceptors.request.use(config => { |
|
|
let result = qs.stringify(params, { arrayFormat: 'repeat' }) |
|
|
let result = qs.stringify(params, { arrayFormat: 'repeat' }) |
|
|
return result |
|
|
return result |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fullUrl = window.location.search; |
|
|
var fullUrl = window.location.search; |
|
|
if (fullUrl.indexOf("?") != -1) { |
|
|
if (fullUrl.indexOf("?") != -1) { |
|
|
fullUrl = fullUrl.substring(1); |
|
|
fullUrl = fullUrl.substring(1); |
|
|
|