Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
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
front-end-dev
techbook
Commits
ee0b468b
Commit
ee0b468b
authored
Aug 17, 2019
by
zhangyanni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
邮箱登录禁止重复提交
parent
a777570c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
10 deletions
+34
-10
emailLoginCmpt.vue
src/components/login/emailLoginCmpt.vue
+34
-10
No files found.
src/components/login/emailLoginCmpt.vue
View file @
ee0b468b
...
...
@@ -43,7 +43,7 @@
<sliderCmpt
@
sendVerification=
"getVerification"
></sliderCmpt>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
class=
"loginButton"
@
click=
"handleLogin(2,'emailYzCodeForm')"
>
登录
<el-button
type=
"primary"
class=
"loginButton"
:disabled=
"flag>0"
@
click=
"handleLogin(2,'emailYzCodeForm')"
>
登录
</el-button>
</el-form-item>
<el-form-item
class=
"registerButton"
>
...
...
@@ -93,7 +93,8 @@
sliderSuccess
:
false
,
timer
:
null
,
showCount
:
true
,
count
:
''
count
:
''
,
flag
:
0
,
}
},
methods
:{
...
...
@@ -152,26 +153,49 @@
apiurl
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
){
that
.
$router
.
replace
(
"/dashboard"
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
}
else
{
that
.
$message
.
error
(
res
.
msg
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
}
}).
catch
((
err
)
=>
{
that
.
$message
.
error
(
err
);
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
})
},
//登录
handleLogin
(
type
,
formName
){
const
that
=
this
;
let
params
;
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
type
==
1
)
that
.
isCheckedPassword
();
//1密码登录 2验证码登录
that
.
submitLoginFormFunc
(
type
);
}
else
{
if
(
this
.
flag
==
0
){
this
.
flag
++
;
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
type
==
1
)
that
.
isCheckedPassword
();
//1密码登录 2验证码登录
that
.
submitLoginFormFunc
(
type
);
}
else
{
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
},
500
)
}
});
}
else
{
setTimeout
(
function
(){
that
.
flag
=
0
;
return
false
;
}
});
},
500
)
}
},
//读取cookie
...
...
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