From c48eafe8411adad734b57b424f5440284dbc85e3 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Wed, 05 Nov 2025 16:15:37 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test
---
src/views/system/userinfo.vue | 63 ++++++++++++++++++++++++++-----
1 files changed, 53 insertions(+), 10 deletions(-)
diff --git a/src/views/system/userinfo.vue b/src/views/system/userinfo.vue
index 197f100..89bc9cf 100644
--- a/src/views/system/userinfo.vue
+++ b/src/views/system/userinfo.vue
@@ -44,7 +44,7 @@
<el-form-item label="姓名:">
<el-input
class="ztzf-input"
- :style="{ width: pxToRem(230) }"
+ :style="{ width: pxToRem(350) }"
v-model="userInfo.realName"
disabled
/>
@@ -52,7 +52,7 @@
<!-- <el-form-item label="昵称:">
<el-input class="ztzf-input" v-model="userInfo.name" />
</el-form-item>-->
- <el-form-item label="所属单位:">
+ <el-form-item label="所属部门:">
<el-input class="ztzf-input" v-model="userInfo.deptName" disabled />
</el-form-item>
<el-form-item label="手机号:">
@@ -165,6 +165,29 @@
}
return true
}
+// 校验密码不能包含中文
+const validatePasswordNoChinese = (password) => {
+ const chineseRegex = /[\u4e00-\u9fa5]/;
+ if (chineseRegex.test(password)) {
+ ElMessage.error('密码不能包含中文字符');
+ return false;
+ }
+ return true;
+};
+// 校验密码复杂度(长度≥6位,包含字母和数字)
+const validatePasswordStrength = (password) => {
+ if (password.length < 6) {
+ ElMessage.error('密码长度不能少于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 passwordForm = ref({
oldPassword: '',
newPassword: '',
@@ -245,6 +268,26 @@
}
});
} else if (checked.value === 1) {
+ // 原始密码校验
+ if (!passwordForm.value.oldPassword) {
+ ElMessage.error('请输入原始密码');
+ return;
+ }
+ // 中文校验
+ if (!validatePasswordNoChinese(passwordForm.value.newPassword)) return;
+ // 新密码校验
+ if (!passwordForm.value.newPassword) {
+ ElMessage.error('请输入新密码');
+ return;
+ }
+ // 确认密码校验
+ if (passwordForm.value.newPassword !== passwordForm.value.newPassword1) {
+ ElMessage.error('两次输入的新密码不一致');
+ return;
+ }
+
+ // 复杂度校验
+ if (!validatePasswordStrength(passwordForm.value.newPassword)) return;
updatePassword(
md5(passwordForm.value.oldPassword),
md5(passwordForm.value.newPassword),
@@ -300,6 +343,7 @@
margin: 16px;
padding: 10px;
background-color: #ffffff;
+ height: 100%;
}
.titleBoxs {
margin: 0 24px;
@@ -319,26 +363,25 @@
:deep(.el-form-item__label) {
color: #000 !important;
}
-:deep(.el-button) {
- width: 150px !important;
-}
+// :deep(.el-button) {
+// width: 150px !important;
+// }
.info {
display: flex;
- justify-content: space-between;
+ justify-content: center;
align-items: center;
padding: 0 80px 0 50px;
+ .section:first-child{
+ margin-right: 50px;}
}
.password {
padding: 0 120px 0 50px;
}
.butn {
- // position: absolute;
- // bottom: 20px;
- // left: 50%;
- // transform: translate(-50%);
display: flex;
justify-content: center;
cursor: pointer;
+
img {
width: 96px;
height: 32px;
--
Gitblit v1.9.3