Gogs 2 miesięcy temu
rodzic
commit
8b5208cbea

+ 4 - 0
src/views/login.vue

@@ -118,6 +118,10 @@ export default {
           this.codeUrl = "data:image/gif;base64," + res.img
           this.loginForm.uuid = res.uuid
         }
+      }).catch(() => {
+        this.captchaEnabled = false
+        this.codeUrl = ""
+        this.loginForm.uuid = ""
       })
     },
     getCookie() {

+ 4 - 0
src/views/register.vue

@@ -122,6 +122,10 @@ export default {
           this.codeUrl = "data:image/gif;base64," + res.img
           this.registerForm.uuid = res.uuid
         }
+      }).catch(() => {
+        this.captchaEnabled = false
+        this.codeUrl = ""
+        this.registerForm.uuid = ""
       })
     },
     handleRegister() {

+ 6 - 5
src/views/storage/overview/index.vue

@@ -336,7 +336,7 @@ export default {
   },
   methods: {
     inventoryRequest(config) {
-      return request({ timeout: 30000, ...config })
+      return request({ timeout: 120000, ...config })
     },
     normalizeResponse(res) {
       if (!res) return null
@@ -444,9 +444,9 @@ export default {
     },
     async refreshData() {
       await this.fetchOverviewData()
-      this.fetchMonthlyComparison()
-      this.fetchSkuSummary()
-      this.fetchSpuSummary()
+      await this.fetchMonthlyComparison()
+      await this.fetchSkuSummary()
+      await this.fetchSpuSummary()
     },
     openUploadDialog() {
       this.uploadDialogVisible = true
@@ -515,7 +515,8 @@ export default {
           url: '/api/inventory/upload',
           method: 'post',
           data: formData,
-          headers: { 'Content-Type': 'multipart/form-data', repeatSubmit: false }
+          headers: { 'Content-Type': 'multipart/form-data', repeatSubmit: false },
+          timeout: 300000
         })
         if (res && res.code === 200) {
           const count = res.data && res.data.count ? res.data.count : 0