Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
national_museum_vod-H5
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fubaole
national_museum_vod-H5
Commits
0fce95ed
Commit
0fce95ed
authored
Apr 19, 2021
by
乐宝呗666
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加邮箱格式校验
parent
a63716e8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
adminInfo.vue
src/views/user/components/adminInfo.vue
+14
-2
No files found.
src/views/user/components/adminInfo.vue
View file @
0fce95ed
...
...
@@ -33,6 +33,7 @@
v-model=
"form.telephone"
placeholder=
"请输入固定电话"
input-align=
"right"
:rules=
"[
{ validator: validatorTel, message: '固定电话格式错误!' }]"
/>
<van-field
label=
"微信"
...
...
@@ -47,6 +48,7 @@
v-model=
"form.email"
placeholder=
"请输入邮箱"
input-align=
"right"
:rules=
"[
{ validator: validatorMail, message: '邮箱格式错误' }]"
/>
</div>
<div
class=
"admin-detail-button"
v-if=
"!disabled"
>
...
...
@@ -61,9 +63,7 @@
</
template
>
<
script
>
// { pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/, message: '固定电话格式错误!'}
// { pattern: /^[a-zA-Z][a-zA-Z0-9_-]{5,19}$/, message: '微信号格式错误!'}
// { pattern: /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/, message: '邮箱格式错误!'}
import
Header
from
"@/components/Header/index.vue"
;
export
default
{
components
:
{
Header
},
...
...
@@ -86,6 +86,18 @@ export default {
this
.
getUserInfo
();
},
methods
:
{
validatorTel
(
val
){
if
(
val
!==
0
&&
val
){
return
/^
((
0
\d{2,3}
-
\d{7,8})
|
(
1
[
3584
]\d{9}))
$/
.
test
(
val
);
}
return
true
},
validatorMail
(
val
)
{
if
(
val
!==
0
&&
val
){
return
/^
[
a-z0-9
]
+
([
._
\\
-
]
*
[
a-z0-9
])
*@
([
a-z0-9
]
+
[
-a-z0-9
]
*
[
a-z0-9
]
+.
){1,63}[
a-z0-9
]
+$/
.
test
(
val
);
}
return
true
},
getUserInfo
()
{
let
vm
=
this
let
param
=
{
...
...
Write
Preview
Markdown
is supported
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