Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 89387b7

Browse files
committed
优化 密码校验规则
1 parent 7633f11 commit 89387b7

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/app/views/UserDetail.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export default {
259259
this.$message({ message: "用户数据已更新", type: "success" });
260260
} catch (error) {
261261
this.$message({
262-
message: "用户资料更新失败,可能是用户名冲突或服务器暂时不可用",
262+
message: error.toString(),
263263
type: "error"
264264
});
265265
}
@@ -288,8 +288,8 @@ export default {
288288
if (!value) return callback(new Error("请输入密码值,若不输入则不进行密码修改"));
289289
if (value.length < 12 || value.length > 36)
290290
return callback(new Error("密码长度不规范,必须长度在 12 位到 36 位之间"));
291-
const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[0-9A-Za-z]{12,}$/;
292-
if (!reg.test(value)) return callback(new Error("您的密码必须包含:数字,大写和小写字母"));
291+
// const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[0-9A-Za-z]{12,}$/;
292+
// if (!reg.test(value)) return callback(new Error("您的密码必须包含:数字,大写和小写字母"));
293293
callback();
294294
},
295295
validatePassword2(rule, value = "", callback) {

src/components/UserInit.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</div>
3434
<div class="row-mt">
3535
<el-input
36-
type="text"
36+
type="password"
3737
v-model="passWord"
3838
autocomplete="off"
3939
placeholder="请输入您要设置的新密码"
@@ -71,6 +71,11 @@ export default {
7171
mounted() {},
7272
methods: {
7373
async submit() {
74+
await this.$confirm(`确定重设密码为:${this.passWord} 吗?`, "重置密码确认", {
75+
confirmButtonText: "确定",
76+
cancelButtonText: "取消",
77+
type: "warning"
78+
});
7479
try {
7580
await request({
7681
method: "PUT",

0 commit comments

Comments
 (0)