<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Sms\Service; use ModStart\Core\Input\Response; use Overtrue\EasySms\EasySms; class AliyunSmsService { private $accessKeyId = ''; private $accessKeySecret = ''; private $signName; private $easySms; public function __construct($oO011, $s3SAB, $aGZpd) { goto PpGZB; utN1d: $this->signName = $aGZpd; goto sC_Wt; PpGZB: $this->accessKeyId = $oO011; goto EQ8ws; EQ8ws: $this->accessKeySecret = $s3SAB; goto utN1d; sC_Wt: $this->easySms = new EasySms(array('timeout' => 30, 'default' => array('strategy' => \Overtrue\EasySms\Strategies\OrderStrategy::class, 'gateways' => array('aliyun')), 'gateways' => array('errorlog' => array('file' => '/tmp/easy-sms.log'), 'aliyun' => array('access_key_id' => $this->accessKeyId, 'access_key_secret' => $this->accessKeySecret, 'sign_name' => $this->signName)))); goto W3kKY; W3kKY: } public function send($fFmiT, $bGSqa, $I3SIX) { try { goto qJGql; HV3PN: return Response::generate(-1, '发送错误'); goto f29OP; fxuA3: if ('success' == $yvBIN['aliyun']['status']) { return Response::generate(0, 'ok'); } goto HV3PN; qJGql: $yvBIN = $this->easySms->send($fFmiT, array('template' => $bGSqa, 'data' => $I3SIX)); goto fxuA3; f29OP: } catch (\Exception $oQDcC) { return Response::generate(-1, '发送错误'); } } }