No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AuthRule.php 989B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Yzncms [ 御宅男工作室 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2007 http://yzncms.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 御宅男 <530765310@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\admin\Model;
  12. use think\Model;
  13. use think\facade\Cache;
  14. /**
  15. * 权限规则模型
  16. */
  17. class AuthRule extends Model
  18. {
  19. const RULE_URL = 1;
  20. const RULE_MAIN = 2; //主菜单
  21. // 自动写入时间戳
  22. protected $autoWriteTimestamp = true;
  23. protected static function init()
  24. {
  25. self::afterWrite(function ($row) {
  26. Cache::rm('__menu__');
  27. });
  28. }
  29. }