WebScanLoginCache.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\common\cache;
  15. class WebScanLoginCache extends BaseCache
  16. {
  17. private $prefix = 'web_scan_';
  18. /**
  19. * @notes 获取扫码登录状态标记
  20. * @param $state
  21. * @return false|mixed
  22. * @author 段誉
  23. * @date 2022/10/20 18:39
  24. */
  25. public function getScanLoginState($state)
  26. {
  27. return $this->get($this->prefix . $state);
  28. }
  29. /**
  30. * @notes 设置扫码登录状态
  31. * @param $state
  32. * @return false|mixed
  33. * @author 段誉
  34. * @date 2022/10/20 18:31
  35. */
  36. public function setScanLoginState($state)
  37. {
  38. $this->set($this->prefix . $state, $state, 600);
  39. return $this->getScanLoginState($state);
  40. }
  41. /**
  42. * @notes 删除缓存
  43. * @param $token
  44. * @return bool
  45. * @author 段誉
  46. * @date 2022/9/16 10:13
  47. */
  48. public function deleteLoginState($state)
  49. {
  50. return $this->delete($this->prefix . $state);
  51. }
  52. }