Merge branch 'dev' into sophie
This commit is contained in:
commit
47ab49cf04
9 files changed
+287
-56
No files matched your search
@@ -50,6 +50,7 @@ import * as XLSX from 'xlsx';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const { showMessageDialog } = useGlobalMessageDialog();
|
||||
const EMAIL_PATTERN = /^[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}$/;
|
||||
|
||||
const sidebarItems = computed(() => {
|
||||
const items = [
|
||||
@@ -308,6 +309,12 @@ const saveUser = async () => {
|
||||
showMessageDialog('warning', t('admin.user.msgs.usernameRequired'));
|
||||
return;
|
||||
}
|
||||
|
||||
const email = (editingUser.value.email || '').trim();
|
||||
if (email && !EMAIL_PATTERN.test(email)) {
|
||||
showMessageDialog('warning', t('admin.user.msgs.invalidEmail'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!editingUser.value.id && !editingUser.value.password) {
|
||||
showMessageDialog('warning', t('admin.user.msgs.passwordRequired'));
|
||||
|
||||
Reference in new issue
Block a user