'AKIDRhiSv84j8H9j25sOdbJq77rKWR6TZOwE', "SecretKey" => 'ziANIxLbbNt87pGQLzMSIr9AuObfWoth', 'region' => 'ap-beijing', 'endpoint' => 'sms.tencentcloudapi.com', ]; return $config; } /** * 发送短信 * * @param [type] $appid * @param [type] $SignName * @param [type] $TemplateId * @param [type] $TemplateParamSet * @param [type] $PhoneNumberSet * @return void * @author wj * @date 2022-07-26 */ public function sendsms($array) { try { $config = $this->getconfig(); $cred = new Credential($config['SecretId'], $config['SecretKey']); $this->cred = $cred; $httpProfile = new HttpProfile(); $httpProfile->setEndpoint($config['endpoint']); $clientProfile = new ClientProfile(); $clientProfile->setHttpProfile($httpProfile); $client = new SmsClient($cred, $config['region'], $clientProfile); $req = new SendSmsRequest(); $req->fromJsonString(json_encode($array)); $resp = $client->SendSms($req); $respArray = $resp->serialize(); $respArray = $respArray['SendStatusSet'][0]; if ('Ok' != $respArray['Code']) { return backarr(0, $respArray['Message']); } return backarr(1, 'suceess'); } catch (TencentCloudSDKException $e) { return backarr(0, $e->getMessage()); } } }