|
...
|
...
|
@@ -3,6 +3,7 @@ |
|
|
|
namespace App\Http\Controllers\Bside;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Helper\FormGlobalsoApi;
|
|
|
|
use App\Http\Logic\Bside\User\UserLogic;
|
|
|
|
use App\Http\Logic\Bside\User\UserLoginLogic;
|
|
|
|
use App\Models\Project\Project;
|
|
...
|
...
|
@@ -125,25 +126,26 @@ class ComController extends BaseController |
|
|
|
$mobile = $request->input('mobile');
|
|
|
|
$user = UserModel::where(['mobile' => $mobile])->first();
|
|
|
|
if (empty($user)) {
|
|
|
|
return $this->response('请输入正确的手机号码!', Code::USER_LOGIN_ERROE);
|
|
|
|
$this->response('请输入正确的手机号码!', Code::USER_LOGIN_ERROE);
|
|
|
|
}
|
|
|
|
$last_sms = SmsLog::getLastLog($mobile, SmsLog::TYPE_LOGIN);
|
|
|
|
if ($last_sms && $last_sms->use = SmsLog::USE_USABLE && time() - strtotime($last_sms->created_at) < 60) {
|
|
|
|
return $this->response('请不要重复发送短信!', Code::USER_LOGIN_ERROE);
|
|
|
|
$this->response('请不要重复发送短信!', Code::USER_LOGIN_ERROE);
|
|
|
|
}
|
|
|
|
$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') {
|
|
|
|
return $this->response('发送失败, 请稍后重试!', Code::USER_LOGIN_ERROE);
|
|
|
|
$this->response('发送失败, 请稍后重试!', Code::USER_LOGIN_ERROE);
|
|
|
|
}
|
|
|
|
SmsLog::createLog($mobile, $code['code']);
|
|
|
|
return $this->response('success');
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function ceshi(){
|
|
|
|
$country = new \App\Helper\Country();
|
|
|
|
return $country->set_country();
|
|
|
|
$from = new FormGlobalsoApi();
|
|
|
|
$list = $from->getInquiryList('https://demomark.globalso.com/',[],1,100000000);
|
|
|
|
$this->response('success',Code::SUCCESS,$list);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|