diff --git a/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataCn.java b/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataCn.java index a396b42d9c..d7ea6f4958 100644 --- a/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataCn.java +++ b/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataCn.java @@ -33,7 +33,7 @@ public class UserExcelDataCn extends UserExcelData { @Length(max = 255) @ExcelProperty("密码") @ColumnWidth(30) - @Pattern(regexp = "^(?![0-9]+$)(?![^0-9]+$)(?![a-zA-Z]+$)(?![^a-zA-Z]+$)(?![a-zA-Z0-9]+$)[a-zA-Z0-9\\S]{8,30}$", message = "{user_import_format_wrong}") + @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[\\s\\S]{8,30}$", message = "{user_import_format_wrong}") private String password; @ExcelProperty("电话") diff --git a/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataTw.java b/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataTw.java index 5a4dc4c804..8cdde42ef9 100644 --- a/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataTw.java +++ b/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataTw.java @@ -33,7 +33,7 @@ public class UserExcelDataTw extends TestCaseExcelData { @Length(max = 255) @ExcelProperty("密碼") @ColumnWidth(30) - @Pattern(regexp = "^(?![0-9]+$)(?![^0-9]+$)(?![a-zA-Z]+$)(?![^a-zA-Z]+$)(?![a-zA-Z0-9]+$)[a-zA-Z0-9\\S]{8,30}$", message = "{user_import_format_wrong}") + @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[\\s\\S]{8,30}$", message = "{user_import_format_wrong}") private String password; @ExcelProperty("電話") diff --git a/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataUs.java b/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataUs.java index 7cd75a84ad..0bba263b27 100644 --- a/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataUs.java +++ b/backend/src/main/java/io/metersphere/excel/domain/UserExcelDataUs.java @@ -34,7 +34,7 @@ public class UserExcelDataUs extends UserExcelData { @Length(max = 255) @ExcelProperty("Password") @ColumnWidth(30) - @Pattern(regexp = "^(?![0-9]+$)(?![^0-9]+$)(?![a-zA-Z]+$)(?![^a-zA-Z]+$)(?![a-zA-Z0-9]+$)[a-zA-Z0-9\\S]{8,30}$", message = "{user_import_format_wrong}") + @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[\\s\\S]{8,30}$", message = "{user_import_format_wrong}") private String password; @ExcelProperty("Phone") diff --git a/frontend/src/business/components/settings/system/EditUser.vue b/frontend/src/business/components/settings/system/EditUser.vue index 8d10d95c68..7727cd1ccf 100644 --- a/frontend/src/business/components/settings/system/EditUser.vue +++ b/frontend/src/business/components/settings/system/EditUser.vue @@ -153,7 +153,7 @@ export default { {required: true, message: this.$t('user.input_password'), trigger: 'blur'}, { required: true, - pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,30}$/, + pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[\s\S]{8,30}$/, message: this.$t('member.password_format_is_incorrect'), trigger: 'blur' }