12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace app\common\service;
- use app\common\library\Sms;
- class SmsSend{
- protected $mobile;
- protected $code;
- protected $event;
- /**
- * @param mixed $mobile
- */
- public static function setMobile($mobile)
- {
- $clss=new self;
- $clss->mobile = $mobile;
- return $clss;
- }
- /**
- * @param mixed $code
- */
- public function setCode($code)
- {
- $this->code = $code;
- return $this;
- }
- /**
- * @param mixed $event
- */
- public function setEvent($event)
- {
- $this->event = $event;
- return $this;
- }
- public function check(){
- $config=config('site.system_sms_open');
- if(!$config){
- return;
- }
- if(!Sms::check($this->mobile,$this->code,$this->event)){
- throw_user('验证码错误');
- }
- }
- }
|