Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
robot-monitor
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
汪晓凯
robot-monitor
Commits
727459d6
Commit
727459d6
authored
Jul 04, 2018
by
wxk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证码倒计时优化
parent
ec50e61c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
16 deletions
+36
-16
api-config.js
src/config/api-config.js
+1
-0
Login.vue
src/views/Login.vue
+13
-14
RobotDetails.vue
src/views/RobotDetails.vue
+6
-1
container.vue
src/views/container.vue
+16
-1
No files found.
src/config/api-config.js
View file @
727459d6
...
...
@@ -7,6 +7,7 @@ const Api = {
GetMatchRobots
:
"/accountlist"
,
//获取符合条件的机器人
GetRobotStatus
:
"/robotStatus"
,
//机器人预警状态查询
GetPlatformInfo
:
"/platform"
,
//交易所及匹配的交易对、目标币信息查询
GetRobotBank
:
"/accountlist"
,
//查询机器人银行账户
}
export
default
Api
;
src/views/Login.vue
View file @
727459d6
...
...
@@ -45,7 +45,7 @@
<i
class=
"iicon pwd"
></i>
<input
type=
"text"
placeholder=
"请输入验证码"
class=
"usercomyzm"
v-model=
"regist_yzm"
>
<el-button
type=
"primary"
class=
"getyzm"
@
click=
"getYZM('regist')"
:disabled=
'!show'
>
<span
v-show =
"
s
how"
>
获取验证码
</span>
<span
v-show =
"how"
>
获取验证码
</span>
<span
v-show =
"!show"
class=
"count"
>
已发送
{{
count
}}
s
</span>
</el-button>
</div>
...
...
@@ -149,28 +149,27 @@ export default {
});
return
;
}
//获取验证码倒计时60s
this
.
count
=
TIME_COUNT
;
this
.
show
=
false
;
this
.
timer
=
setInterval
(()
=>
{
if
(
this
.
count
>
0
&&
this
.
count
<=
TIME_COUNT
){
this
.
count
--
;
}
else
{
this
.
show
=
true
;
clearInterval
(
this
.
timer
);
this
.
timer
=
null
;
}
},
1000
)
axios
.
post
(
ApiConfig
.
SendEmailVcode
,{
"user"
:
Email
}).
then
(
res
=>
{
// console.log(res)
if
(
res
.
status
==
200
&&
res
.
data
==
"emailsend success"
){
//发送成功并且注册成功
//获取验证码倒计时60s
this
.
count
=
TIME_COUNT
;
this
.
show
=
false
;
this
.
timer
=
setInterval
(()
=>
{
if
(
this
.
count
>
0
&&
this
.
count
<=
TIME_COUNT
){
this
.
count
--
;
}
else
{
this
.
show
=
true
;
clearInterval
(
this
.
timer
);
this
.
timer
=
null
;
}
},
1000
)
this
.
$notify
({
title
:
'提示'
,
message
:
"验证码发送成功,请查收"
,
type
:
'success'
,
duration
:
'2000'
,
});
}
else
{
//不存在的33.cn的邮箱
this
.
$notify
({
title
:
'提示'
,
...
...
src/views/RobotDetails.vue
View file @
727459d6
...
...
@@ -113,6 +113,8 @@
<
script
>
import
Bus
from
'../assets/js/bus'
import
axios
from
'axios'
;
import
ApiConfig
from
"../config/api-config"
;
export
default
{
data
(){
return
{
...
...
@@ -120,10 +122,13 @@
}
},
props
:
[
'robotDetailInfo'
],
created
()
{
},
methods
:
{
closeDetails
()
{
Bus
.
$emit
(
'hideDetails'
)
}
}
,
}
}
</
script
>
...
...
src/views/container.vue
View file @
727459d6
...
...
@@ -48,6 +48,7 @@
},
created
()
{
this
.
getPlatInfo
();
this
.
getRobotBank
();
if
(
!
sessionStorage
.
getItem
(
"isLogin"
))
{
this
.
$router
.
push
({
path
:
'/'
...
...
@@ -60,7 +61,21 @@
this
.
platInfo
=
res
.
data
.
data
;
// console.log(this.platInfo)
})
}
},
getRobotBank
()
{
const
params
=
{
"class"
:
"bank"
,
//账户级别 有robot bank admin三个返回数据也不同
"coin"
:[],
//目标币种,用于首页里的筛选和币种监控 可选参数
"symbol"
:[],
//币种对,用于网站监控里的筛选 可选参数
"status"
:
""
,
//机器人运行状态 可选参数
"abnormal"
:
""
,
//有profit,coin,base这三种异常类别 可选参数
"platform"
:[]
//交易所种类 可选参数
}
axios
.
post
(
ApiConfig
.
GetRobotBank
,
params
).
then
(
res
=>
{
console
.
log
(
res
.
data
)
})
},
}
}
</
script
>
...
...
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