From 64f50960a7a230747bcff185b66c1bec4752d449 Mon Sep 17 00:00:00 2001 From: wangqiujuan0808 <578331299@qq.com> Date: Tue, 13 Aug 2024 21:08:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EditPass.vue | 6 ++++-- src/views/Login.vue | 31 ++++++++++++++++--------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/components/EditPass.vue b/src/components/EditPass.vue index 30a36e7..40aa939 100644 --- a/src/components/EditPass.vue +++ b/src/components/EditPass.vue @@ -89,8 +89,10 @@ export default { // 请求数据 const param = { name: store.state.userInfo.nickName, - password: md5(state.formData.oldPass).toUpperCase(), - new_password: md5(state.formData.newPass).toUpperCase() + password: state.formData.oldPass, + new_password: state.formData.newPass, + // password: md5(state.formData.oldPass).toUpperCase(), + // new_password: md5(state.formData.newPass).toUpperCase() } const res = await myApi.editPass(param); if (res.code == 0) { diff --git a/src/views/Login.vue b/src/views/Login.vue index 448827e..b2319d9 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -77,24 +77,25 @@ export default { // 1. 编码数据 const userInfo = { username: state.ruleForm.username, - password: md5(state.ruleForm.password).toUpperCase(), + password: state.ruleForm.password + // password: md5(state.ruleForm.password).toUpperCase(), } // 模拟登录 - localSet("token", '99999999999999999'); - store.commit("setUserInfo", userInfo); - window.location.href = '/'; + // localSet("token", '99999999999999999'); + // store.commit("setUserInfo", userInfo); + // window.location.href = '/'; - // myApi.login(userInfo).then(async (res) => { - // if (res.code == 0) { - // let userInfo = { - // nickName: state.ruleForm.username, - // }; - // store.commit("setUserInfo", userInfo); - // getLoginStatus(); - // } else { - // ElMessage.error(res.message); - // } - // }) + myApi.login(userInfo).then(async (res) => { + if (res.code == 0) { + let userInfo = { + nickName: state.ruleForm.username, + }; + store.commit("setUserInfo", userInfo); + getLoginStatus(); + } else { + ElMessage.error(res.message); + } + }) } else { return false; }