发送短信提示

master
zhanglingsheng 5 years ago
parent d85e570e97
commit 48297738b9

@ -1491,9 +1491,12 @@ class UserController extends BaseController
*/
public function send_sms()
{
$data = json_decode(base64_decode(file_get_contents("php://input")), true);
$phone = $data['phone'];
if (!preg_match('/^((13[0-9])|(14[5,7,9])|(15[^4])|(18[0-9])|(17[0,1,3,5,6,7,8]))\\d{8}$/', $phone)) {
$this -> new_set_message(1098, "手机格式不正确");
die;
}
if ($data['reg'] == 1) { /* 注册检查 */
$user = M('user', 'tab_') -> where(['phone|account' => $phone]) -> find();
if ($user) {
@ -1510,10 +1513,7 @@ class UserController extends BaseController
} elseif ($data['reg'] == 4) {/* 解绑检查 */
}elseif(!preg_match('/^((13[0-9])|(14[5,7,9])|(15[^4])|(18[0-9])|(17[0,1,3,5,6,7,8]))\\d{8}$/', $user['password'])) {
$this -> new_set_message(1098, "手机格式不正确");
die;
}
}
$this -> sms_send($phone);

Loading…
Cancel
Save