From e3c2cd23253f3501be7d31e03955fbb6f4aa3556 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Fri, 15 May 2026 16:30:04 +0800
Subject: [PATCH] Merge branch 'refs/heads/feature/v9.0/9.0.4' into prod
---
src/subPackages/userDetail/password/index.vue | 35 ++++++++++++++++++++++++-----------
1 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/src/subPackages/userDetail/password/index.vue b/src/subPackages/userDetail/password/index.vue
index 387d854..9de5039 100644
--- a/src/subPackages/userDetail/password/index.vue
+++ b/src/subPackages/userDetail/password/index.vue
@@ -21,7 +21,17 @@
</view>
<view class="btngroup">
<u-button color="#AEAEAE" class="custom-style" shape="circle" @click="reset">重置</u-button>
- <u-button color="#1D6FE9" class="custom-style" shape="circle" @click="submit">提交</u-button>
+ <u-button
+ :color="submitLoading ? '#AEAEAE' : '#1D6FE9'"
+ class="custom-style"
+ shape="circle"
+ text="提交"
+ :loading="submitLoading"
+ loading-text="提交中"
+ loading-mode="circle"
+ :loading-size="13"
+ @click="submit"
+ />
</view>
</view>
</template>
@@ -46,6 +56,7 @@
newPassword: '',
newPassword1: '',
});
+ const submitLoading = ref(false);
// 校验密码不能包含中文
const validatePasswordNoChinese = (password) => {
const chineseRegex = /[\u4e00-\u9fa5]/;
@@ -71,12 +82,6 @@
});
return false;
}
- // const hasLetter = /[a-zA-Z]/.test(password);
- // const hasNumber = /\d/.test(password);
- // if (!hasLetter || !hasNumber) {
- // ElMessage.error('密码需同时包含字母和数字');
- // return false;
- // }
return true;
};
const clearForm = () => {
@@ -90,6 +95,7 @@
clearForm();
};
const submit = () => {
+ if (submitLoading.value) return;
// 原始密码校验
if (!passwordForm.value.oldPassword) {
@@ -125,6 +131,7 @@
// 复杂度校验
if (!validatePasswordStrength(passwordForm.value.newPassword)) return;
+ submitLoading.value = true;
updatePassword(md5(passwordForm.value.oldPassword),
md5(passwordForm.value.newPassword),
md5(passwordForm.value.newPassword1)).then(res => {
@@ -132,14 +139,17 @@
uni.showToast({
title: '修改信息成功',
icon: 'none',
- duration: 2000
+ duration: 1500
});
clearForm();
userStore.setUserInfo(null)
uni.removeStorageSync('rememberedUser');
- uni.reLaunch({
- url: '/pages/login/index'
- })
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '/pages/login/index'
+ })
+ }, 1500);
+ return
} else {
uni.showToast({
@@ -148,7 +158,10 @@
duration: 2000
});
}
+ submitLoading.value = false;
+ }).catch(() => {
+ submitLoading.value = false;
});
};
--
Gitblit v1.9.3