Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Officeyutong committed Jun 11, 2024
1 parent 0fe0412 commit ce16a08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/views/utils/SendSMSCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ const SendSMSCodeDialog: React.FC<React.PropsWithChildren<{ phone: string; mustN
};
})();
}, [state]);
const sendCode = async () => {
const sendCode = async (currAuthResult?: string) => {
setSended(true);
setState(States.CODE_SENDING);
let resp = await utilClient.sendSMSCode(phone, authResult, mustNotUse);
let resp = await utilClient.sendSMSCode(phone, currAuthResult || authResult, mustNotUse);
setMessage(resp.message);
if (resp.code === -1) setState(States.CODE_ERROR);
else setState(States.CODE_SENDED);
Expand Down Expand Up @@ -94,7 +94,7 @@ const SendSMSCodeDialog: React.FC<React.PropsWithChildren<{ phone: string; mustN
setAuthResult(resp);
setState(States.AUTHED);
// 阿里云2的验证成功了可以直接发送
sendCode();
sendCode(resp);
}}
retrying={sended}
></AliyunCaptchaNew>
Expand All @@ -105,7 +105,7 @@ const SendSMSCodeDialog: React.FC<React.PropsWithChildren<{ phone: string; mustN
<Button color="green" onClick={onClose}>
关闭
</Button>
{(state >= States.AUTHED) && (captchaPrep?.provider !== "aliyun2") && <Button color="green" loading={state === States.CODE_SENDING} onClick={sendCode}>
{(state >= States.AUTHED) && (captchaPrep?.provider !== "aliyun2") && <Button color="green" loading={state === States.CODE_SENDING} onClick={() => sendCode()}>
{!sended ? "发送验证码" : "重发验证码"}
</Button>}
</Grid.Column>
Expand Down

0 comments on commit ce16a08

Please sign in to comment.