From 539d1ce6b955d5d56b21d97590a2a684c400f64a Mon Sep 17 00:00:00 2001
From: zhangxiaoxu123 <819527061@qq.com>
Date: 星期三, 11 一月 2023 09:55:16 +0800
Subject: [PATCH] 细节调节

---
 src/router/axios.js |   57 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/router/axios.js b/src/router/axios.js
index dbda9e7..ce0cc1d 100644
--- a/src/router/axios.js
+++ b/src/router/axios.js
@@ -21,19 +21,20 @@
 NProgress.configure({
   showSpinner: false
 })
-let loadingInstance =null;
+let loadingInstance = null;
 // HTTPrequest鎷︽埅
 axios.interceptors.request.use(config => {
-  NProgress.start() // start progress bar
+  /*NProgress.start() // start progress bar
  loadingInstance = Loading.service({
    lock: true,
    text: '',
    spinner: 'el-icon-loading',
-   background: 'rgba(0, 0, 0, 0)'
- });
+   background: 'rgba(255, 0, 0, 0)'
+ });*/
   const TENANT_ID = getStore({ name: 'tenantId' })
   const isToken = (config.headers || {}).isToken === false
-  const token = store.getters.access_token
+  // const token = window.android.getAppToken()
+  const token = `8d47d31b-2c41-47e6-9870-b7208447b9fe`
   if (token && !isToken) {
     config.headers['Authorization'] = 'Bearer ' + token// token
   }
@@ -46,14 +47,14 @@
     config.data = serialize(config.data)
     delete config.data.serialize
   }
-  config.headers['VERSION'] = 'lmm'
-  if (config.method === 'get'||config.params) {
+  // config.headers['VERSION'] = 'GHX'
+  if (config.method === 'get' || config.params) {
     config.paramsSerializer = function (params) {
-      let p ={};
-      for(let i in params){
-        if(typeof params[i] == 'string' &&!params[i]){
+      let p = {};
+      for (let i in params) {
+        if (typeof params[i] == 'string' && !params[i]) {
 
-        }else{
+        } else {
           p[i] = params[i]
         }
       }
@@ -68,31 +69,31 @@
 
 // HTTPresponse鎷︽埅
 axios.interceptors.response.use(res => {
-  NProgress.done()
-  loadingInstance.close();
+  // NProgress.done()
+  // loadingInstance.close();
   const status = Number(res.status) || 200
   const message = res.data.msg || errorCode[status] || errorCode['default']
- /* if (status === 401) {
-    // Message({
-    //   message: message,
-    //   type: 'error'
-    // })
+  /*if (status === 401) {
+    Message({
+      message: message,
+      type: 'error'
+    })
     handleError(message)
     store.dispatch('FedLogOut').then(() => {
-      router.push({ path: '/login' })
+      router.push({ path: '/pad' })
     })
     return
   }*/
 
-  // if (status !== 200 || res.data.code === 1) {
-  //   // Message({
-  //   //   message: message,
-  //   //   type: 'error'
-  //   // })
-  //   // handleError(message)
-  //   return handleError(message)
-  //   // return Promise.reject(new Error(message))
-  // }
+  /*if (status !== 200 || res.data.code === 1) {
+    Message({
+      message: message,
+      type: 'error'
+    })
+    handleError(message)
+    return handleError(message)
+    // return Promise.reject(new Error(message))
+  }*/
   return res
 }, error => {
   NProgress.done()

--
Gitblit v1.9.1