Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
6603e31d
Unverified
Commit
6603e31d
authored
Oct 07, 2021
by
mmc001
Committed by
GitHub
Oct 07, 2021
Browse files
Update validate.js (#493)
Edit validate email for support all email language and prevent matching multiple @ signs:
parent
bdb7b983
Changes
1
Hide whitespace changes
Inline
Side-by-side
litemall-admin/src/utils/validate.js
View file @
6603e31d
...
...
@@ -60,7 +60,7 @@ export function validAlphabets(str) {
* @returns {Boolean}
*/
export
function
validEmail
(
email
)
{
const
reg
=
/^
(([^
<>()
\[\]\\
.,;:
\s
@
"
]
+
(\.[^
<>()
\[\]\\
.,;:
\s
@
"
]
+
)
*
)
|
(
".+"
))
@
((\[[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\])
|
(([
a-zA-Z
\-
0-9
]
+
\.)
+
[
a-zA-Z
]{2,}))
$/
const
reg
=
/^
[^
\s
@
]
+
@
[^
\s
@
]
+
\.[^\s
@
]
+
$/
return
reg
.
test
(
email
)
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment