短信验证

This commit is contained in:
“wanyongkang”
2022-05-13 17:23:31 +08:00
parent 7bf5866d7c
commit 2f3d3e7391
4 changed files with 157 additions and 2 deletions

30
extends/redis/Redisop.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
namespace extend\redis;
class Redisop {
private $redis;
public function __construct()
{
$this->redis = new \Redis();
$this->redis->connect('127.0.0.1', 6379);
$this->redis->auth('123456');
}
public function setOfTime($key = '', $value = '') {
if (empty($key)) {
die;
}
$this->redis->set( $key , $value);
$this->redis->expire($key,60);
}
public function get($key = '') {
if (empty($key)) {
die;
}
return $this->redis->get( $key );
}
}