From c6b042c732734445eab254f20a119a80e381283e Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Thu, 16 Dec 2021 10:04:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E4=B8=80=E4=B8=AA=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E4=B8=80=E5=88=86=E9=92=9F=E5=86=85=E5=8F=AA=E8=83=BD=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E4=B8=80=E6=AC=A1=E9=AA=8C=E8=AF=81=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=AD=90=E8=B4=A6=E5=8F=B7=E4=BA=A4=E6=8E=A5?= =?UTF-8?q?=EF=BC=8C=E6=8E=92=E9=99=A4=E7=A6=81=E7=94=A8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/loginPhone.js | 22 ++++++++++++++-------- src/pages/system/account/list/delAuth.js | 8 ++++---- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/pages/login/loginPhone.js b/src/pages/login/loginPhone.js index 80cf905e..12c6f32f 100644 --- a/src/pages/login/loginPhone.js +++ b/src/pages/login/loginPhone.js @@ -97,18 +97,22 @@ function FormDom(props) { //发送短信验证码 const sendCode=()=>{ let startTime=localStorage.getItem('now'); - console.log(100,startTime); + let sendPhone=localStorage.getItem('phone'); if(!startTime){ sendCodeApi(); }else{ - let stopTime=startTime*1+60000;//一分钟后的时间戳 - let currentime=new Date().getTime(); //点击获取当前的时间戳 - if(currentime-startTime<=stopTime-startTime){//一分钟内 - Notify.clear(); - Notify.warn('发送过于频繁,请稍后再试'); - console.log(109,currentime-startTime<=stopTime-startTime); + if(sendPhone==phone){ + let stopTime=startTime*1+60000;//一分钟后的时间戳 + let currentime=new Date().getTime(); //点击获取当前的时间戳 + if(currentime-startTime<=stopTime-startTime){//一分钟内 + Notify.clear(); + Notify.warn('发送过于频繁,请稍后再试'); + }else{ + localStorage.removeItem('now'); + localStorage.removeItem('phone'); + sendCodeApi(); + } }else{ - localStorage.removeItem('now'); sendCodeApi(); } } @@ -121,6 +125,7 @@ function FormDom(props) { handelResponse(res,(response,msg)=>{ let clickNow=new Date().getTime();//当前时间 localStorage.setItem('now',clickNow); + localStorage.setItem('phone',phone); let timer=60; let timecount=setInterval(()=>{ let timerId=timer--; @@ -136,6 +141,7 @@ function FormDom(props) { },(err)=>{ Notify.error(err) localStorage.setItem('now',new Date().getTime()); + localStorage.setItem('phone',phone); }) }).catch(err=>{ diff --git a/src/pages/system/account/list/delAuth.js b/src/pages/system/account/list/delAuth.js index 47beda85..9fe8763f 100644 --- a/src/pages/system/account/list/delAuth.js +++ b/src/pages/system/account/list/delAuth.js @@ -78,11 +78,11 @@ export default class acclistDom extends React.Component{ } getsubAppoint(aid,data).then(res=>{ handelResponse(res,(response,msg)=>{ - let authdata=response.data; + let authdata=response.data.filter(item=>item.status==1); let authData=authdata.map(item=>{ - return { - text:item.real_name, - key:item.id + return { + text:item.real_name, + key:item.id } }) self.setState({downLevel:authData.length>0,authperson:authData,downLeveldata:authData});