|
@@ -67,7 +67,7 @@ class VerifyCode
|
|
|
// 如果是阿里云
|
|
// 如果是阿里云
|
|
|
if ($type == 'aliyun') {
|
|
if ($type == 'aliyun') {
|
|
|
// 发送短信
|
|
// 发送短信
|
|
|
- $result = Aliyun::sendSms($phone, config('verifycode.aliyun.sms_sign'), config('verifycode.aliyun.sms_tpl'), ['code' => $content]);;
|
|
|
|
|
|
|
+ $result = Aliyun::sendSms($phone, config('verifycode.aliyun.sms_sign'), config('verifycode.aliyun.sms_tpl'), ['code' => $content]);
|
|
|
// 如果code不是03
|
|
// 如果code不是03
|
|
|
if (isset($result['error'])) return ['error' => $result['error'], 'data' => $result];
|
|
if (isset($result['error'])) return ['error' => $result['error'], 'data' => $result];
|
|
|
// 返回结果
|
|
// 返回结果
|
|
@@ -85,4 +85,19 @@ class VerifyCode
|
|
|
// 返回结果
|
|
// 返回结果
|
|
|
return ['error' => '未知运营商,请配置运营商类型'];
|
|
return ['error' => '未知运营商,请配置运营商类型'];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ public function sendContent($phone, $content)
|
|
|
|
|
+ {
|
|
|
|
|
+ // 判断运营商,以方便发送短信
|
|
|
|
|
+ $type = config('verifycode.operator_type');
|
|
|
|
|
+ // 如果是阿里云
|
|
|
|
|
+ if ($type == 'aliyun') {
|
|
|
|
|
+ // 发送短信
|
|
|
|
|
+ $result = Aliyun::sendSms($phone, config('verifycode.aliyun_website.sms_sign'), config('verifycode.aliyun_website.sms_tpl'),$content);
|
|
|
|
|
+ // 如果code不是03
|
|
|
|
|
+ if (isset($result['error'])) return ['error' => $result['error'], 'data' => $result];
|
|
|
|
|
+ // 返回结果
|
|
|
|
|
+ return $result;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|