cmbYouku_Api/app/service/UserService.php

31 lines
716 B
PHP
Raw Normal View History

2024-07-01 15:57:07 +08:00
<?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]);
}
}