| // +------------------------------------------------+ namespace app\mobile\controller; use app\common\model\Member as MemberModel; use app\common\service\Sms as SmsService; class Sms extends _Init { public function _initialize() { } /** * [短信验证码] * * @return [type] [description] */ public function getsms() { $mobile = $this->request->post('mobile'); $forget = $this->request->post('forget'); $MemberInfo = MemberModel::where('username', $mobile)->find(); if (! empty($MemberInfo) && empty($forget)) { return $this->error('这个手机号已经注册过了'); } $res = SmsService::send($mobile); if ($res === true) { return $this->success('发送成功:短信验证码6666'); } else { return $this->error($res); } } /** * [短信验证码] * * @return [type] [description] */ public function getresms() { $mobile = $this->request->post('mobile'); $MemberInfo = MemberModel::where('username', $mobile)->find(); $res = SmsService::send($mobile); if ($res === true) { return $this->success('发送成功'); } else { return $this->error($res); } } }