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