dataInfo(['uniacid'=>$uniacid]); $accessKeyId = trim($config['short_id']); $accessKeySecret = trim($config['short_secret']); $config = new Config([ // 必填,您的 AccessKey ID "accessKeyId" => $accessKeyId, // 必填,您的 AccessKey Secret "accessKeySecret" => $accessKeySecret ]); // 访问的域名 $config->endpoint = "dyvmsapi.aliyuncs.com"; return new Dyvmsapi($config); } /** * @param $uniacid * @param $phone * @功能说明:电话通知 * @author chenniang * @DataTime: 2022-12-08 18:03 */ public static function main($uniacid,$phone){ $client = self::createClient($uniacid); $config_model = new \app\reminder\model\Config(); $config = $config_model->dataInfo(['uniacid'=>$uniacid]); $singleCallByTtsRequest = new SingleCallByTtsRequest([ "calledNumber" => $phone, "ttsCode" => $config['reminder_tmpl_id'], "calledShowNumber" => $config['reminder_public']==0?$config['reminder_phone']:'', ]); $runtime = new RuntimeOptions([]); try { // 复制代码运行请自行打印 API 的返回值 $res = $client->singleCallByTtsWithOptions($singleCallByTtsRequest, $runtime); $res = object_array($res); return !empty($res['body'])?$res['body']:[]; } catch (Exception $error) { if (!($error instanceof TeaError)) { $error = new TeaError([], $error->getMessage(), $error->getCode(), $error); } // 如有需要,请打印 error Utils::assertAsString($error->message); } } }