新增发送短信log记录
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Extend\Alibaba;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Model\LogSms;
|
||||
use App\Utils\Log;
|
||||
use Darabonba\OpenApi\OpenApiClient;
|
||||
use AlibabaCloud\OpenApiUtil\OpenApiUtilClient;
|
||||
|
||||
@@ -100,13 +101,21 @@ class Dysms
|
||||
throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::CODE_FAIL));
|
||||
}
|
||||
|
||||
Log::getInstance()->info("发送短信日志:" . json_encode($result['body'],JSON_UNESCAPED_UNICODE));
|
||||
|
||||
if ($result['body']['Code'] != "OK"){
|
||||
throw new BusinessException($result['body']['MessageIm'],HttpEnumCode::CODE_FAIL);
|
||||
if (isset($result['body']['MessageIm'])){
|
||||
throw new BusinessException($result['body']['MessageIm'],HttpEnumCode::CODE_FAIL);
|
||||
}
|
||||
throw new BusinessException("短信发送失败",HttpEnumCode::CODE_FAIL);
|
||||
}
|
||||
|
||||
if (empty($result['body']['RequestId'])){
|
||||
// 无唯一值
|
||||
throw new BusinessException($result['body']['MessageIm'],HttpEnumCode::CODE_FAIL);
|
||||
if (isset($result['body']['MessageIm'])){
|
||||
throw new BusinessException($result['body']['MessageIm'],HttpEnumCode::CODE_FAIL);
|
||||
}
|
||||
throw new BusinessException("短信发送失败",HttpEnumCode::CODE_FAIL);
|
||||
}
|
||||
|
||||
// 记录log
|
||||
|
||||
Reference in New Issue
Block a user