request->get(); $type = isset($get['type']) ? $get['type'] : 0; $mobile = isset($get['mobile']) ? $get['mobile'] : 0; if (stringUtil::isMobile($mobile) == false) { util::fail('请填写手机号'); } $code = stringUtil::getRandNum(4); $msg = "您的验证码:" . $code . "。为了您的帐号安全,验证码不要告诉别人哦"; $userId = $this->userId; if ($type == 1) { //设置申请会员验证码的缓存 SmsService::setApplyMemberCode($userId, $mobile, $code); } else { util::fail('发送失败'); } sms::send($mobile, $msg, $this->sj); util::complete('已发送'); } }