|
...
|
...
|
@@ -82,18 +82,18 @@ class LoginController extends BaseController |
|
|
|
$mobile = $this->param['mobile'];
|
|
|
|
$manager = Manage::where(['mobile' => $mobile])->first();
|
|
|
|
if (empty($manager)) {
|
|
|
|
$this->response('请输入正确的手机号码!', Code::USER_LOGIN_ERROE);
|
|
|
|
$this->response('请输入正确的手机号码!', Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
$last_sms = SmsLog::getLastLog($mobile, SmsLog::TYPE_MANAGER_LOGIN);
|
|
|
|
if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) {
|
|
|
|
$this->response('请不要重复发送短信!', Code::USER_LOGIN_ERROE);
|
|
|
|
$this->response('请不要重复发送短信!', Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
$template = config('aliyunsms.login_sms_temp');
|
|
|
|
$code['code'] = rand(100000,999999);
|
|
|
|
$ali_sms = new AliSms();
|
|
|
|
$send = $ali_sms->sendSms(strval($mobile), $template, $code);
|
|
|
|
if (empty($send->Code) && $send->Code != 'OK') {
|
|
|
|
$this->response('发送失败, 请稍后重试!', Code::USER_LOGIN_ERROE);
|
|
|
|
$this->response('发送失败, 请稍后重试!', Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
SmsLog::createLog($mobile, $code['code'],SmsLog::TYPE_MANAGER_LOGIN);
|
|
|
|
$this->response('success');
|
...
|
...
|
|