From e417bd6251d1fb18586233ad4874bffd0bf21784 Mon Sep 17 00:00:00 2001 From: liushilong <2224574157@qq.com> Date: Mon, 25 Mar 2024 16:56:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9axios=E5=AE=9E?= =?UTF-8?q?=E4=BE=8Bbug,=E8=B0=83=E6=95=B4=E7=99=BB=E5=BD=95Input=E7=9A=84?= =?UTF-8?q?maxlength?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/http/axios/checkStatus.ts | 4 +++- src/utils/http/axios/index.ts | 2 +- src/views/login/components/Forget.vue | 7 +++++-- src/views/login/components/Login.vue | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/utils/http/axios/checkStatus.ts b/src/utils/http/axios/checkStatus.ts index 3a26090..230e740 100644 --- a/src/utils/http/axios/checkStatus.ts +++ b/src/utils/http/axios/checkStatus.ts @@ -33,7 +33,9 @@ export function checkStatus(status: number, msg: string): void { $message.error('网络请求超时') break case 500: - $message.error('服务器错误,请联系管理员!') + // 若服务出现问题 则无法执行后续操作,故此处判断提示为登录失败 + // $message.error('服务器错误,请联系管理员!') + $message.error('登录失败,请联系管理员!') break case 501: $message.error('网络未实现') diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index dc087ee..e819c07 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -201,7 +201,7 @@ const transform: AxiosTransform = { // eslint-disable-next-line ts/no-use-before-define const instance = http.getAxios() const config = response.config - const whitelist = ['/api/captcha/captchatoken', '/api/captcha/captchaImage', '/api/backstage/adminlogin', '/api/oauthweb/token','/api/web/smslogin/login','/api/web/smslogin/sendcode'] + const whitelist = ['/api/captcha/captchatoken', '/api/captcha/captchaImage', '/api/backstage/adminlogin', '/api/oauthweb/token','/api/web/smslogin/login','/api/web/smslogin/sendcode','/api/ocr/sUser/selectSUser'] const expirationTime = storage.get(TOKEN_EXPIRATION_TIME) // console.log('剩余失效时间(分):', (expirationTime - Date.now()) / 1000 / 60, config.url) diff --git a/src/views/login/components/Forget.vue b/src/views/login/components/Forget.vue index 42a4aca..8607a51 100644 --- a/src/views/login/components/Forget.vue +++ b/src/views/login/components/Forget.vue @@ -203,6 +203,7 @@ function forget() { v-model:value="formForget.agentcode" class="item-input" placeholder="请输入企业编码" + maxlength="20" >