| 123456789101112131415161718192021222324252627 |
- <?php
- namespace app\api\controller\v1;
- use think\Cache;
- class TestRedis
- {
- public function index()
- {
- $token = request()->param("token", null);
- if (!$token) {
- return json(["code" => 0, "message" => "token 不存在", "data" => null]);
- }
- if(Cache::store('default')->set("test_1989_name",$token,30)){
- echo Cache::store('default')->get("test_1989_name");
- exit;
- }
- echo "存取失败";exit;
- $token_value = Cache::store("default")->get($token);
- dump($token_value);
- die;
- }
- }
|