同一个账号一分钟内只能请求一次验证码,选择子账号交接,排除禁用状态
This commit is contained in:
parent
5aac48d596
commit
c6b042c732
|
@ -97,18 +97,22 @@ function FormDom(props) {
|
||||||
//发送短信验证码
|
//发送短信验证码
|
||||||
const sendCode=()=>{
|
const sendCode=()=>{
|
||||||
let startTime=localStorage.getItem('now');
|
let startTime=localStorage.getItem('now');
|
||||||
console.log(100,startTime);
|
let sendPhone=localStorage.getItem('phone');
|
||||||
if(!startTime){
|
if(!startTime){
|
||||||
sendCodeApi();
|
sendCodeApi();
|
||||||
}else{
|
}else{
|
||||||
|
if(sendPhone==phone){
|
||||||
let stopTime=startTime*1+60000;//一分钟后的时间戳
|
let stopTime=startTime*1+60000;//一分钟后的时间戳
|
||||||
let currentime=new Date().getTime(); //点击获取当前的时间戳
|
let currentime=new Date().getTime(); //点击获取当前的时间戳
|
||||||
if(currentime-startTime<=stopTime-startTime){//一分钟内
|
if(currentime-startTime<=stopTime-startTime){//一分钟内
|
||||||
Notify.clear();
|
Notify.clear();
|
||||||
Notify.warn('发送过于频繁,请稍后再试');
|
Notify.warn('发送过于频繁,请稍后再试');
|
||||||
console.log(109,currentime-startTime<=stopTime-startTime);
|
|
||||||
}else{
|
}else{
|
||||||
localStorage.removeItem('now');
|
localStorage.removeItem('now');
|
||||||
|
localStorage.removeItem('phone');
|
||||||
|
sendCodeApi();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
sendCodeApi();
|
sendCodeApi();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,6 +125,7 @@ function FormDom(props) {
|
||||||
handelResponse(res,(response,msg)=>{
|
handelResponse(res,(response,msg)=>{
|
||||||
let clickNow=new Date().getTime();//当前时间
|
let clickNow=new Date().getTime();//当前时间
|
||||||
localStorage.setItem('now',clickNow);
|
localStorage.setItem('now',clickNow);
|
||||||
|
localStorage.setItem('phone',phone);
|
||||||
let timer=60;
|
let timer=60;
|
||||||
let timecount=setInterval(()=>{
|
let timecount=setInterval(()=>{
|
||||||
let timerId=timer--;
|
let timerId=timer--;
|
||||||
|
@ -136,6 +141,7 @@ function FormDom(props) {
|
||||||
},(err)=>{
|
},(err)=>{
|
||||||
Notify.error(err)
|
Notify.error(err)
|
||||||
localStorage.setItem('now',new Date().getTime());
|
localStorage.setItem('now',new Date().getTime());
|
||||||
|
localStorage.setItem('phone',phone);
|
||||||
})
|
})
|
||||||
}).catch(err=>{
|
}).catch(err=>{
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ export default class acclistDom extends React.Component{
|
||||||
}
|
}
|
||||||
getsubAppoint(aid,data).then(res=>{
|
getsubAppoint(aid,data).then(res=>{
|
||||||
handelResponse(res,(response,msg)=>{
|
handelResponse(res,(response,msg)=>{
|
||||||
let authdata=response.data;
|
let authdata=response.data.filter(item=>item.status==1);
|
||||||
let authData=authdata.map(item=>{
|
let authData=authdata.map(item=>{
|
||||||
return {
|
return {
|
||||||
text:item.real_name,
|
text:item.real_name,
|
||||||
|
|
Loading…
Reference in New Issue