'发送失败','data'=>$result]; // 返回结果 return $result; } // 如果是阿里云 if( $type == 'aliyun' ) { // 发送短信 $result = Aliyun::sendSms($phone,config('verifycode.aliyun.sms_sign'),config('verifycode.aliyun.sms_tpl'),['code'=>$verifyCode]);; // 如果code不是03 if( isset($result['error']) ) return ['error'=>$result['error'],'data'=>$result]; // 返回结果 return $result; } // 如果是阿里云 if( $type == 'tencent' ) { // 发送短信 $result = Tencent::sendSms($phone,config('verifycode.tencent.sms_sign'),config('verifycode.tencent.sms_tpl'),[$verifyCode]); // 如果code不是03 if( isset($result['error']) ) return ['error'=>$result['error'],'data'=>$result]; // 返回结果 return $result; } // 返回结果 return ['error'=>'未知运营商,请配置运营商类型']; } public function sendRemind($phone,$content){ // 判断运营商,以方便发送短信 $type = config('verifycode.operator_type'); // 如果是国都 if( $type == 'guodu' ) { // 发送短信 $result = GuoDu::sendSms($phone,$content,config('verifycode.guodu.sms_sign')); // 如果code不是03 if( $result['code'] != '03' && $result['code'] != '01') return ['error'=>'发送失败','data'=>$result]; // 返回结果 return $result; } // 如果是阿里云 if( $type == 'aliyun' ) { // 发送短信 $result = Aliyun::sendSms($phone,config('verifycode.aliyun.sms_sign'),config('verifycode.aliyun.sms_tpl'),['code'=>$content]);; // 如果code不是03 if( isset($result['error']) ) return ['error'=>$result['error'],'data'=>$result]; // 返回结果 return $result; } // 如果是阿里云 if( $type == 'tencent' ) { // 发送短信 $result = Tencent::sendSms($phone,config('verifycode.tencent.sms_sign'),config('verifycode.tencent.sms_tpl'),[$content]); // 如果code不是03 if( isset($result['error']) ) return ['error'=>$result['error'],'data'=>$result]; // 返回结果 return $result; } // 返回结果 return ['error'=>'未知运营商,请配置运营商类型']; } }