Index.php 573 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Cache;
  5. use think\Controller;
  6. /**
  7. * 首页接口
  8. */
  9. class Index extends Controller
  10. {
  11. protected $noNeedLogin = ['*'];
  12. protected $noNeedRight = ['*'];
  13. /**
  14. * 首页
  15. *
  16. */
  17. public function index()
  18. {
  19. $redis = new \Redis();
  20. $redis->connect(Config("host"),Config("port"));
  21. Cache::store('redis')->set('name','陈豪',3600);
  22. $a= Cache::store('redis')->get('name');
  23. halt($a);
  24. // $this->success('请求成功');
  25. }
  26. }