Browse Source

速运行李上传修改

zhongxiaoyu 2 years ago
parent
commit
741914300d
4 changed files with 5 additions and 3 deletions
  1. 1 1
      public/config.js
  2. 2 1
      src/api/dataIntegration.js
  3. 1 1
      src/utils/request.js
  4. 1 0
      src/views/upload/index.vue

+ 1 - 1
public/config.js

@@ -200,5 +200,5 @@ window.SERVICE_ID = {
   sysServiceAddXyId: 10, //系统设置-服务管理-新增服务-新增数据源-提交
   sysDataTabId: 9, //系统设置-数据结构-数据项-表格-增删改
 
-  expressTransportationUpload: 20037, // 速运行李数据查询
+  expressTransportationUpload: 20034, // 速运行李数据上传
 }

+ 2 - 1
src/api/dataIntegration.js

@@ -82,7 +82,8 @@ export function UploadFile(params) {
     headers: {
       'content-type': 'multipart/form-data'
     },
-    data: params
+    data: params,
+    noToken: true,
   })
 }
 

+ 1 - 1
src/utils/request.js

@@ -24,7 +24,7 @@ service.interceptors.request.use(
   (config) => {
     // do something before request is sent
     // config.headers['Content-Type'] = 'text/plain'
-    if (store.getters.token) {
+    if (store.getters.token && !config.noToken) {
       // let each request carry token
       // ['X-Token'] is a custom headers key
       // please modify it according to the actual situation

+ 1 - 0
src/views/upload/index.vue

@@ -301,6 +301,7 @@ export default {
         const formData = new FormData()
         formData.append('file', file)
         formData.append('serviceId', SERVICE_ID.expressTransportationUpload)
+        formData.append('token', '167885843630200099999999')
         const { code } = await UploadFile(formData)
         if (Number(code) !== 0) {
           throw new Error('失败')