| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\admin\service;
- use think\facade\Cache;
- class TriggerService
- {
- /**
- * 更新菜单缓存
- * @param null $adminId
- * @return bool
- */
- public static function updateMenu($adminId = null)
- {
- if(empty($adminId)){
- Cache::tag('initAdmin')->clear();
- }else{
- Cache::delete('initAdmin_' . $adminId);
- }
- return true;
- }
- /**
- * 更新节点缓存
- * @param null $adminId
- * @return bool
- */
- public static function updateNode($adminId = null)
- {
- if(empty($adminId)){
- Cache::tag('authNode')->clear();
- }else{
- Cache::delete('allAuthNode_' . $adminId);
- }
- return true;
- }
- /**
- * 更新系统设置缓存
- * @return bool
- */
- public static function updateSysConfig(): bool
- {
- Cache::tag('sysConfig')->clear();
- return true;
- }
- }
|