From b8ea96007a8dc353cbb11e18f5529b1d7a692bb6 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Wed, 19 Mar 2025 15:31:19 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?=
=?UTF-8?q?=E5=90=8E=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../NavBar/components/UserProfile.vue | 70 +++++++------------
1 file changed, 27 insertions(+), 43 deletions(-)
diff --git a/src/layout/components/NavBar/components/UserProfile.vue b/src/layout/components/NavBar/components/UserProfile.vue
index 609eede..4d8c80b 100644
--- a/src/layout/components/NavBar/components/UserProfile.vue
+++ b/src/layout/components/NavBar/components/UserProfile.vue
@@ -18,44 +18,33 @@
modal-append-to-body
append-to-body
v-model="dialogVisible"
+ @close="reset"
width="400px"
>
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
@@ -84,25 +73,19 @@ const router = useRouter();
const dialogVisible = ref(false);
const formLoading = ref(false);
-const state = reactive({
- ip1Type: "password",
- ip2Type: "password",
- ip3Type: "password",
-});
-const { ip1Type, ip2Type, ip3Type } = toRefs(state);
const form = reactive({
oldPass: "",
newPass: "",
rnewPass: "",
});
-// 修改密码框类型
-function changeInputType(key: "ip1Type" | "ip2Type" | "ip3Type") {
- if (state[key] == "text") {
- state[key] = "password";
- } else {
- state[key] = "text";
- }
+
+function reset() {
+ form.oldPass = "";
+ form.newPass = "";
+ form.rnewPass = "";
+ refForm.value.resetFields();
}
+
const validateNewPass = (rule: any, value: string, callback: (error?: Error) => void) => {
if (!form.newPass) {
callback(new Error(" "));
@@ -157,6 +140,7 @@ function submitHandle() {
password: form.newPass,
});
ElNotification.success("修改成功,请重新登陆");
+ logout();
} catch (error) {
formLoading.value = false;
console.log(error);