From 24b4c282a1e91143d66f1eeed2cabffa654c7c13 Mon Sep 17 00:00:00 2001
From: zhizhijie <zhizhijie@users.noreply.gitee.com>
Date: 星期三, 16 九月 2026 13:41:57 +0800
Subject: [PATCH] feat(h2031): 适配模板新增「统一社会信用代码/填报单位」两列并入库;fix(import): 补录 2023 年货运量周转量;fix(login/report): 验证码容错、预览指标对齐、弹窗可拖动圆角、失败提示细分;docs: 新增问题与注意事项汇总

---
 traffic-audit-web/src/views/Login.vue |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/traffic-audit-web/src/views/Login.vue b/traffic-audit-web/src/views/Login.vue
index 2227171..fbe98ac 100644
--- a/traffic-audit-web/src/views/Login.vue
+++ b/traffic-audit-web/src/views/Login.vue
@@ -40,16 +40,20 @@
       captchaId: '',
       clickIds: [],
       loggingIn: false,
-      captchaRequired: true
+      captchaRequired: false
     }
   },
   created() {
-    axios.get('/api/auth/captcha-config')
+    // 楠岃瘉鐮佹槸鍚﹀惎鐢ㄤ竴寰嬩互鍚庣 /api/auth/captcha-config 涓哄噯锛�
+    // 榛樿涓嶆樉绀猴紝鍙湁鍚庣鏄庣‘杩斿洖 required=true 鎵嶆覆鏌撻獙璇佺爜缁勪欢銆�
+    // 淇锛氭鍓嶉粯璁� true 涓旇姹傚け璐ユ椂闈欓粯蹇界暐锛屽垏鎹㈢綉缁滃悗璇ラ厤缃涓嶅埌锛�
+    // 鐧诲綍椤靛氨浼氭畫鐣欎竴涓姞杞戒笉鍑烘潵鐨勯獙璇佺爜鐧芥骞舵彁绀衡�滈獙璇佺爜鍔犺浇澶辫触锛岃妫�鏌ョ綉缁溾�濄��
+    axios.get('/api/auth/captcha-config', { timeout: 10000 })
       .then(res => {
         const d = res.data
-        if (d && d.code === 200) this.captchaRequired = d.data.required !== false
+        this.captchaRequired = !!(d && d.code === 200 && d.data && d.data.required === true)
       })
-      .catch(() => {})
+      .catch(() => { this.captchaRequired = false })
   },
   methods: {
     onCaptchaVerified(payload) {
@@ -75,14 +79,14 @@
           password: this.form.password,
           captchaId: this.captchaId,
           captchaClickIds: this.clickIds
-        }).then(res => {
+        }, { timeout: 15000 }).then(res => {
           this.loggingIn = false
           const d = res.data
           if (d.code === 200) {
-            localStorage.setItem('token', d.data.token)
-            localStorage.setItem('username', d.data.username)
-            localStorage.setItem('realName', d.data.realName || '')
-            localStorage.setItem('modules', d.data.modules || '')
+            sessionStorage.setItem('token', d.data.token)
+            sessionStorage.setItem('username', d.data.username)
+            sessionStorage.setItem('realName', d.data.realName || '')
+            sessionStorage.setItem('modules', d.data.modules || '')
             this.$message.success('鐧诲綍鎴愬姛')
             this.$router.push('/dashboard')
           } else if (d.code === 401) {
@@ -95,8 +99,9 @@
             this.$message.error(d.message || '鐧诲綍澶辫触锛岃閲嶈瘯')
             if (this.$refs.captcha) this.$refs.captcha.load()
           }
-        }).catch(() => {
+        }).catch(e => {
           this.loggingIn = false
+          if (e && e.code === 'ECONNABORTED') { this.$message.error('鐧诲綍璇锋眰瓒呮椂锛岃閲嶈瘯'); return }
           this.$message.error('缃戠粶閿欒锛岀櫥褰曞け璐�')
         })
       })

--
Gitblit v1.9.1