本文整理汇总了PHP中Sms::findPwd方法的典型用法代码示例。如果您正苦于以下问题:PHP Sms::findPwd方法的具体用法?PHP Sms::findPwd怎么用?PHP Sms::findPwd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sms
的用法示例。
在下文中一共展示了Sms::findPwd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: POST_phoneAction
/**
* 发送手机验证码
* @method POST_phoneAction
* @author NewFuture
*/
public function POST_phoneAction()
{
$response['status'] = 0;
if (!Input::post('phone', $phone, Config::get('regex.phone'))) {
$response['info'] = '手机号格式有误或者不支持!';
} elseif (!Input::post('account', $account, Config::get('regex.account'))) {
$response['info'] = '账号有误,如果账号忘记请联系云印工作人员';
} elseif (!($Printer = PrinterModel::where('account', $account)->field('id,phone')->find())) {
$response['info'] = '尚未注册';
} elseif (!Safe::checkTry('pwd_phone_' . $account)) {
$response['info'] = '尝试次数过多,临时封禁!';
} elseif (!$Printer['phone'] || $Printer['phone'] != $phone) {
$response['info'] = '绑定手机不一致,或者手机号错误';
} elseif (!Sms::findPwd($phone, $code = Random::number(6))) {
$response['info'] = '短信发送出错,请联系我们!';
} else {
/*发送成功*/
$find = ['id' => $Printer['id'], 'account' => $account, 'code' => strtoupper($code)];
Session::set('find_info_p', $find);
Safe::del('pwd_phone_' . $account);
$response['status'] = 1;
$response['info'] = '验证短信已发送';
}
$this->response = $response;
}
示例2: POST_phoneAction
/**
* 发送手机验证码
* @method POST_phoneAction
* @author NewFuture
*/
public function POST_phoneAction()
{
$response['status'] = 0;
if (!Input::post('phone', $phone, Config::get('regex.phone'))) {
$response['info'] = '手机号格式有误或者不支持!';
} elseif (!Input::post('number', $number, 'card')) {
$response['info'] = '学号格式有误!';
} elseif (!Safe::checkTry('pwd_phone_' . $number)) {
$response['info'] = '尝试次数过多,临时封禁!';
} elseif (!($user = UserModel::where('number', $number)->field('id,phone')->find())) {
$response['info'] = '尚未注册,或者学号错误';
} elseif (empty($user['phone'])) {
$response['info'] = '未绑定手机号,或者学号错误';
} elseif (Encrypt::encryptPhone($phone, $number, $user['id']) != $user['phone']) {
$response['info'] = '绑定手机不一致,或者手机号错误';
} elseif (!Sms::findPwd($phone, $code = Random::code(6))) {
$response['info'] = '短信发送出错,请联系我们!';
} else {
/*发送成功*/
$find = ['id' => $user['id'], 'number' => $number, 'code' => strtoupper($code)];
Session::set('find_info', $find);
Safe::del('pwd_phone_' . $number);
$response['status'] = 1;
$response['info'] = '短信已发送';
}
$this->response = $response;
}