Skip to content

The open source simple and complete warehouse management system is derived from our many years of experience in implementing erp projects. We stripped the original commercial system wms function and opened it up for free, hoping to help the majority of small and medium-sized enterprises. At present, the system supports cross-platform。

feat(Register): add vaild email

liufu3b5899a97e6b
diff --git a/frontend/src/components/login/login-form.vue b/frontend/src/components/login/login-form.vue
index f4f429a..6a75a8f 100644
--- a/frontend/src/components/login/login-form.vue
+++ b/frontend/src/components/login/login-form.vue
@@ -54,7 +54,7 @@ const data = reactive({
user_name: '',
auth_string: '',
email: '',
- sex: '',
+ // sex: '',
is_valid: true
},
userNameVaildRules: [(v: string) => !!v || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('login.userName') }!`],
@@ -133,7 +133,7 @@ const method = reactive({
user_name: '',
auth_string: '',
email: '',
- sex: '',
+ // sex: '',
is_valid: true
}
data.showDialog = true
diff --git a/frontend/src/components/login/user-register-form.vue b/frontend/src/components/login/user-register-form.vue
index eb882a7..157e02d 100644
--- a/frontend/src/components/login/user-register-form.vue
+++ b/frontend/src/components/login/user-register-form.vue
@@ -82,7 +82,7 @@ const data = reactive({
(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.user_register_name') }!`
],
auth_string: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.auth_string') }!`],
- email: [],
+ email: [(val: string) => method.verifyMailbox(val)],
sex: [(val: string) => !!val || `${ i18n.global.t('system.checkText.mustInput') }${ i18n.global.t('base.userManagement.sex') }!`],
contact_tel: [],
is_valid: []
@@ -98,6 +98,19 @@ const data = reactive({
})
const method = reactive({
+ // Verify mailbox
+ verifyMailbox: (val: string) => {
+ if (!val) {
+ return true
+ }
+ const RE = new RegExp(
+ /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
+ )
+ if (RE.test(val)) {
+ return true
+ }
+ return i18n.global.t('system.tips.vaildEmail')
+ },
// Get the options required by the drop-down box
getCombobox: () => {
// Static drop-down box
@@ -118,15 +131,15 @@ const method = reactive({
if (valid) {
const form = {
- id: 0,
- user_num: '',
- user_name: data.form.user_name,
- auth_string: Md5.hashStr(data.form.auth_string as string),
- email: data.form.email,
- sex: data.form.sex,
- is_valid: true
- }
-
+ id: 0,
+ user_num: '',
+ user_name: data.form.user_name,
+ auth_string: Md5.hashStr(data.form.auth_string as string),
+ email: data.form.email,
+ sex: data.form.sex,
+ is_valid: true
+ }
+
const { data: res } = await registerUser(form)
if (!res.isSuccess) {
hookComponent.$message({
diff --git a/frontend/src/languages/langs/cnZh.ts b/frontend/src/languages/langs/cnZh.ts
index 3ed1515..5fb890e 100644
--- a/frontend/src/languages/langs/cnZh.ts
+++ b/frontend/src/languages/langs/cnZh.ts
@@ -38,7 +38,8 @@ export default {
beforeAsnUnload: '确认卸货?',
beforeAsnSorted: '确认分拣完成?',
requestTimeout: '请求超时!',
- requestFail: '接口请求失败,请重试'
+ requestFail: '接口请求失败,请重试',
+ vaildEmail: '请输入正确的邮箱格式!'
},
checkText: {
checkFormFail: '操作失败, 请检查数据后重试!',
diff --git a/frontend/src/languages/langs/enUs.ts b/frontend/src/languages/langs/enUs.ts
index 8e5e60a..76d7cc5 100644
--- a/frontend/src/languages/langs/enUs.ts
+++ b/frontend/src/languages/langs/enUs.ts
@@ -38,7 +38,8 @@ export default {
beforeAsnUnload: 'Confirm Unload?',
beforeAsnSorted: 'Confirm Sorted?',
requestTimeout: 'Request Timeout!',
- requestFail: 'Request fail.Please try it again'
+ requestFail: 'Request fail.Please try it again',
+ vaildEmail: 'Please enter the correct email format!'
},
checkText: {
checkFormFail: 'Operation failed. Please check the data and try again!',