优化验证码获取逻辑
Signed-off-by: vilson <545522390@qq.com>
This commit is contained in:
parent
0ab700ebf8
commit
4290688db0
@ -118,6 +118,7 @@ class Login extends BasicApi
|
|||||||
{
|
{
|
||||||
$mobile = $this->request->post('mobile', '');
|
$mobile = $this->request->post('mobile', '');
|
||||||
$code = RandomService::numeric(6);
|
$code = RandomService::numeric(6);
|
||||||
|
if (config('sms.debug')) {
|
||||||
$sms = new Sms();
|
$sms = new Sms();
|
||||||
$result = $sms->vSend($mobile, [
|
$result = $sms->vSend($mobile, [
|
||||||
'data' => [
|
'data' => [
|
||||||
@ -128,6 +129,7 @@ class Login extends BasicApi
|
|||||||
if (isError($result)) {
|
if (isError($result)) {
|
||||||
$this->error('系统繁忙');
|
$this->error('系统繁忙');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
session('captcha', $code);
|
session('captcha', $code);
|
||||||
$this->success('', config('sms.debug') ? $code : '');
|
$this->success('', config('sms.debug') ? $code : '');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user