浏览代码

修改bug

chenrui 1 年之前
父节点
当前提交
375683afb3
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      src/utils/request.js

+ 5 - 4
src/utils/request.js

@@ -168,11 +168,12 @@ service.interceptors.response.use((response) => {
   
   
   // 防重复提交时间戳
   // 防重复提交时间戳
   const mainInterfaceList = store.getters.mainInterfaceList
   const mainInterfaceList = store.getters.mainInterfaceList
-  const hasPath = mainInterfaceList.find(item => response.config.url.indexOf(item)>=0)
-  if(hasPath){
-    store.commit('SET_noRestTimeStr', response.data.data.updateDate)
+  if(mainInterfaceList){
+    const hasPath = mainInterfaceList.find(item => response.config.url.indexOf(item)>=0)
+    if(hasPath){
+      store.commit('SET_noRestTimeStr', response.data.data.updateDate)
+    }
   }
   }
-  
   return response.data
   return response.data
 }, err)
 }, err)