短信验证

This commit is contained in:
“wanyongkang”
2022-05-13 17:39:41 +08:00
parent a2fb12bf71
commit 81bd95922d
2 changed files with 3 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ class Index
public function getCode() { public function getCode() {
$phone = json_decode(file_get_contents("php://input"), true)['phone']; $phone = json_decode(file_get_contents("php://input"), true)['phone'];
$redis = new Redisop; $redis = new Redisop();
$user_model = new UserModel(); $user_model = new UserModel();
$is_exit = $user_model->getOne(['Phone' => $phone]); $is_exit = $user_model->getOne(['Phone' => $phone]);
if($is_exit) { if($is_exit) {
@@ -107,7 +107,7 @@ class Index
echo json_encode($info); echo json_encode($info);
die; die;
} }
$redis = new Redisop; $redis = new Redisop();
$code = $redis->get($data['LoginCode']); $code = $redis->get($data['LoginCode']);

View File

@@ -18,7 +18,7 @@ class Redisop {
die; die;
} }
$this->redis->set( $key , $value); $this->redis->set( $key , $value);
$this->redis->expire($key,120); $this->redis->expire($key,180);
} }
public function get($key = '') { public function get($key = '') {