yangsai@163.com 6 months ago
parent 2dc6f3bbda
commit f873b788a5
  1. 7
      application/controllers/Api/Login.php

@ -161,11 +161,10 @@
$sms = new AliyunSms($accessKeyId, $accessKeySecret, $signName, $templateCode);
$code = substr(str_shuffle('0123456789'),0,6);
$templateParam = array(
// 'code' => $code // 模板中变量的值
'code' => '123456' // 模板中变量的值
'code' => $code // 模板中变量的值
);
// $result = $sms->sendSMS($phone, $templateParam);
// if(!$result) Tool_Fnc::apiMsg('短信发送失败', '500');
$result = $sms->sendSMS($phone, $templateParam);
if(!$result) Tool_Fnc::apiMsg('短信发送失败', '500');
$data['phone'] = $phone;
$data['code'] = $code;
$data['created'] = date("Y-m-d H:i:s",time());

Loading…
Cancel
Save