Commit 727459d6 authored by wxk's avatar wxk

验证码倒计时优化

parent ec50e61c
......@@ -7,6 +7,7 @@ const Api = {
GetMatchRobots: "/accountlist",//获取符合条件的机器人
GetRobotStatus: "/robotStatus",//机器人预警状态查询
GetPlatformInfo: "/platform",//交易所及匹配的交易对、目标币信息查询
GetRobotBank: "/accountlist",//查询机器人银行账户
}
export default Api;
......@@ -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 = "show">获取验证码</span>
<span v-show = "how">获取验证码</span>
<span v-show = "!show" class="count">已发送{{count}} s</span>
</el-button>
</div>
......@@ -149,6 +149,9 @@ export default {
});
return;
}
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;
......@@ -161,16 +164,12 @@ export default {
this.timer = null;
}
}, 1000)
axios.post(ApiConfig.SendEmailVcode,{"user":Email}).then(res => {
// console.log(res)
if(res.status == 200&& res.data == "emailsend success"){//发送成功并且注册成功
this.$notify({
title: '提示',
message: "验证码发送成功,请查收",
type: 'success',
duration:'2000',
});
}else{//不存在的33.cn的邮箱
this.$notify({
title: '提示',
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment