TriggerService.php 945 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\admin\service;
  3. use think\facade\Cache;
  4. class TriggerService
  5. {
  6. /**
  7. * 更新菜单缓存
  8. * @param null $adminId
  9. * @return bool
  10. */
  11. public static function updateMenu($adminId = null)
  12. {
  13. if(empty($adminId)){
  14. Cache::tag('initAdmin')->clear();
  15. }else{
  16. Cache::delete('initAdmin_' . $adminId);
  17. }
  18. return true;
  19. }
  20. /**
  21. * 更新节点缓存
  22. * @param null $adminId
  23. * @return bool
  24. */
  25. public static function updateNode($adminId = null)
  26. {
  27. if(empty($adminId)){
  28. Cache::tag('authNode')->clear();
  29. }else{
  30. Cache::delete('allAuthNode_' . $adminId);
  31. }
  32. return true;
  33. }
  34. /**
  35. * 更新系统设置缓存
  36. * @return bool
  37. */
  38. public static function updateSysConfig(): bool
  39. {
  40. Cache::tag('sysConfig')->clear();
  41. return true;
  42. }
  43. }