Parcourir la source

优化请求超时的问题

ZaiZai il y a 2 ans
Parent
commit
a2bf8eab84
3 fichiers modifiés avec 7 ajouts et 7 suppressions
  1. 1 1
      src/api/request/index.js
  2. 4 4
      src/views/data-fill/division.vue
  3. 2 2
      vite.config.js

+ 1 - 1
src/api/request/index.js

@@ -6,7 +6,7 @@ import {getToken} from '~src/api/util/auth';
 import {toSerialize} from "vue-utils-plus"
 
 //默认超时时间
-axios.defaults.timeout = 300000;
+axios.defaults.timeout = 0;
 //返回其他状态码
 axios.defaults.validateStatus = function (status) {
     return status >= 200 && status <= 500;

+ 4 - 4
src/views/data-fill/division.vue

@@ -1104,8 +1104,8 @@ const deltableexcel =async (row) => {
     }else{
           window?.$message?.warning('该表不允许删除')
     }
-    
-   
+
+
 }
 //树配置
 const addingFormTreeRef = ref(null)
@@ -1145,10 +1145,10 @@ const addingFormTreeClick = async (data, node) => {
     } else if (node?.level === 2) {
         searchFormPage.value.total = 1
         dialogTableData.value = [data]
-       
+
         nextTick(()=>{
             dialogTableRef.value?.toggleRowSelection(data,true);
-            
+
         })
         selectItems.value.push(data)
     }

+ 2 - 2
vite.config.js

@@ -36,8 +36,8 @@ export default defineConfig({
         }),
     ],
     server: {
-        //port: '3001',
-        //host: '0.0.0.0',
+        port: '3001',
+        host: '0.0.0.0',
         proxy: {
             '/api': {
                 ws: true,