|
@@ -3,6 +3,7 @@ import axios from 'axios'
|
|
|
import vueAxios from 'vue-axios'
|
|
|
import store from '@/store'
|
|
|
import { message } from '@/api/scan/config.js'
|
|
|
+import lStorage from '@/utils/localStorage';
|
|
|
|
|
|
Vue.use(vueAxios, axios)
|
|
|
//创建实例
|
|
@@ -14,11 +15,21 @@ const service = axios.create({
|
|
|
|
|
|
//request拦截
|
|
|
service.interceptors.request.use(config => {
|
|
|
- config.cancelToken = new axios.CancelToken(cancel => {
|
|
|
- if (config.url !== `${message}/message/update-state` || config.url !== '/image-service/common/multipart_upload') {
|
|
|
- store.commit('setAxiosArr', {cancel})
|
|
|
- }
|
|
|
- })
|
|
|
+ config.cancelToken = new axios.CancelToken(cancel => {
|
|
|
+ if (config.url !== `${message}/message/update-state` || config.url !== '/image-service/common/multipart_upload') {
|
|
|
+ store.commit('setAxiosArr', { cancel })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ let projectId = store.state.layout.projectId
|
|
|
+ ? store.state.layout.projectId
|
|
|
+ : lStorage.get("projectId");
|
|
|
+ let group_code = store.state.layout.group_code
|
|
|
+ ? store.state.layout.group_code
|
|
|
+ : lStorage.get("group_code");
|
|
|
+ config.headers = {
|
|
|
+ projectId: projectId,
|
|
|
+ groupCode: group_code
|
|
|
+ };
|
|
|
return config
|
|
|
}, error => {
|
|
|
console.log(error)
|