31 lines
716 B
PHP
31 lines
716 B
PHP
<?php
|
|
|
|
namespace app\service;
|
|
|
|
use app\config\BusinessCacheKey;
|
|
use app\exception\BusinessException;
|
|
use app\service\util\SmsUtil;
|
|
use app\sms\AliSms;
|
|
use think\facade\Log;
|
|
|
|
class UserService extends BaseService
|
|
{
|
|
public function getUrl($params)
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* @throws BusinessException
|
|
*/
|
|
public function loginSendSms($params)
|
|
{
|
|
Log::info('参数' . json_encode($params));
|
|
|
|
$key = SmsUtil::getSmsKey($params['phone']);
|
|
SmsUtil::requestLimit($key, BusinessCacheKey::SITE_SMS_CODE['ttl']);
|
|
|
|
$code = SmsUtil::getSmsCode($key, BusinessCacheKey::SITE_SMS_CODE['ttl']);
|
|
AliSms::sendSms(['phone_numbers' => $params['phone'], 'code' => $code]);
|
|
}
|
|
} |