接口文件在阿里大鱼官方手册内有
public function alidayu($mobile){
include VENDOR_DIR ."/alidayu/TopSdk.php";//引入入口文件date_default_timezone_set('Asia/Shanghai');
$content = rand(100000,999999);
$signname = "登录验证";
$c = new \TopClient;
$c->appkey = "23491577";//必填用户appkey
$c->secretKey = "60c9cab4f6913daa49c53f5fd0dc5d15";//必填 用户secretKey
$req = new \AlibabaAliqinFcSmsNumSendRequest;
$req->setSmsType("normal");//短信接口填写normal
$req->setSmsFreeSignName($signname);
$req->setSmsParam("{\"code\":\"".$content."\",\"product\":\"诺蜜\"}");//验证码和网站名字
$req->setRecNum($mobile);
$req->setSmsTemplateCode("SMS_13745711");//短息模板 由阿里大鱼用户提供认证通过才行
$resp = $c->execute($req);
if($resp->result->success){
return $content;
}else{
return 'error';
}
}