From 5998fc3edd2e14101775835ccbe1291fc88cc5e7 Mon Sep 17 00:00:00 2001 From: Ran_Chen <1908198662@qq.com> Date: Tue, 1 Apr 2025 10:59:35 +0800 Subject: [PATCH] =?UTF-8?q?user=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B9=B6=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/manager-web/src/apis/httpRequest.js | 5 +- main/manager-web/src/apis/module/user.js | 4 +- .../assets/header/{roboot.png => robot.png} | Bin .../src/components/ChangePasswordDialog.vue | 109 ++++++++++-------- main/manager-web/src/components/HeaderBar.vue | 12 +- main/manager-web/src/store/index.js | 2 +- main/manager-web/src/views/login.vue | 24 ++-- 7 files changed, 84 insertions(+), 72 deletions(-) rename main/manager-web/src/assets/header/{roboot.png => robot.png} (100%) diff --git a/main/manager-web/src/apis/httpRequest.js b/main/manager-web/src/apis/httpRequest.js index 98f47bf7..4d8093d3 100755 --- a/main/manager-web/src/apis/httpRequest.js +++ b/main/manager-web/src/apis/httpRequest.js @@ -105,11 +105,12 @@ function httpHandlerError(info, callBack) { /** 请求成功,退出该函数 可以根据项目需求来判断是否请求成功。这里判断的是status为200的时候是成功 */ let networkError = false if (info.status === 200) { - if (info.data.code === 'success' || info.data.code === 0 || info.data.code === undefined) { return networkError }else if (info.data.code === 401) { - goToPage(Constant.PAGE.LOGIN, true) + console.log('触发 401,清除 Token 并跳转登录页'); + store.commit('clearAuth'); + window.location.href = '/login'; return true } else { showDanger(info.data.msg) diff --git a/main/manager-web/src/apis/module/user.js b/main/manager-web/src/apis/module/user.js index 1fb3503d..5ce20941 100755 --- a/main/manager-web/src/apis/module/user.js +++ b/main/manager-web/src/apis/module/user.js @@ -138,8 +138,8 @@ export default { .url(`${getServiceUrl()}/api/v1/user/change-password`) .method('PUT') .data({ - old_password: oldPassword, - new_password: newPassword, + password: oldPassword, + newPassword: newPassword, }) .success((res) => { RequestService.clearRequestTime(); diff --git a/main/manager-web/src/assets/header/roboot.png b/main/manager-web/src/assets/header/robot.png similarity index 100% rename from main/manager-web/src/assets/header/roboot.png rename to main/manager-web/src/assets/header/robot.png diff --git a/main/manager-web/src/components/ChangePasswordDialog.vue b/main/manager-web/src/components/ChangePasswordDialog.vue index 19c20fd6..ffefdb41 100644 --- a/main/manager-web/src/components/ChangePasswordDialog.vue +++ b/main/manager-web/src/components/ChangePasswordDialog.vue @@ -1,57 +1,63 @@