|
@@ -409,8 +409,6 @@ export default {
|
|
|
qwOpen:false,
|
|
|
// 部门名称
|
|
|
deptName: undefined,
|
|
|
- // 默认密码
|
|
|
- initPassword: undefined,
|
|
|
// 日期范围
|
|
|
dateRange: [],
|
|
|
// 状态数据字典
|
|
@@ -485,6 +483,11 @@ export default {
|
|
|
],
|
|
|
password: [
|
|
|
{ required: true, message: "员工密码不能为空", trigger: "blur" },
|
|
|
+ {
|
|
|
+ pattern: /^(?=.*[A-Za-z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,20}$/,
|
|
|
+ message: "密码长度为 8-20 位,必须包含字母、数字和特殊字符",
|
|
|
+ trigger: ["blur", "change"],
|
|
|
+ }
|
|
|
],
|
|
|
idCard: [
|
|
|
{ required: true, message: "身份证号不能为空", trigger: "blur" },
|
|
@@ -523,9 +526,6 @@ export default {
|
|
|
this.getDicts("company_user_sex").then((response) => {
|
|
|
this.sexOptions = response.data;
|
|
|
});
|
|
|
- this.getConfigKey("sys.user.initPassword").then((response) => {
|
|
|
- this.initPassword = response.msg;
|
|
|
- });
|
|
|
this.getDicts("sys_qw_user_status").then(response => {
|
|
|
this.qwStatusOptions = response.data;
|
|
|
});
|
|
@@ -700,7 +700,7 @@ export default {
|
|
|
this.roleOptions = response.roles;
|
|
|
this.open = true;
|
|
|
this.title = "添加员工";
|
|
|
- this.form.password = this.initPassword;
|
|
|
+ this.form.password = null;
|
|
|
});
|
|
|
},
|
|
|
qwBind(row){
|
|
@@ -758,6 +758,18 @@ export default {
|
|
|
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
+ inputPlaceholder: "8-20 位,包含字母、数字和特殊字符",
|
|
|
+ inputValidator: (value) => {
|
|
|
+ const pattern = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,20}/;
|
|
|
+ const hasChinese = /[\u4e00-\u9fa5]/.test(value);
|
|
|
+ const hasFullWidth = /[!-~]/.test(value);
|
|
|
+
|
|
|
+ if (hasChinese) return '不能包含中文字符';
|
|
|
+ if (hasFullWidth) return '不能包含全角符号,请使用英文输入法';
|
|
|
+ if (!pattern.test(value)) return '密码格式错误:需包含字母、数字和英文特殊字符,长度为 8-20 位';
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
})
|
|
|
.then(({ value }) => {
|
|
|
resetUserPwd(row.userId, value).then((response) => {
|