|
|
@@ -1,17 +1,18 @@
|
|
|
import Vue from 'vue'
|
|
|
import Axios from 'axios'
|
|
|
|
|
|
-const service = Axios.create({
|
|
|
- withCredentials: true,
|
|
|
- baseUrl: '/'
|
|
|
-})
|
|
|
-
|
|
|
export function axiosHttp(store) {
|
|
|
-
|
|
|
+ const service = Axios.create({
|
|
|
+ withCredentials: true,
|
|
|
+ baseUrl: '/'
|
|
|
+ })
|
|
|
service.interceptors.request.use(config => {
|
|
|
- if (config.url.indexOf('.') === -1) {
|
|
|
- config.url = process.env.baseUrl + config.url
|
|
|
+ if (process.server) {
|
|
|
+ if (config.url.indexOf('.') === -1) {
|
|
|
+ config.url = process.env.baseUrl + config.url
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log(config.url)
|
|
|
// if (typeof window === 'undefined') {
|
|
|
// config.headers.cookie = store.state.option.cookies + '; ' + store.state.option.sessionId
|
|
|
// // config.headers['User-Agent'] = Vue.$store.state.option.userAgent
|