AuthController.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\supplier;
  12. use crmeb\basic\BaseController;
  13. /**
  14. * 基类 所有控制器继承的类
  15. * Class AuthController
  16. * @package app\controller\admin
  17. * @method success($msg = 'ok', array $data = [])
  18. * @method fail($msg = 'error', array $data = [])
  19. */
  20. class AuthController extends BaseController
  21. {
  22. /**
  23. * 当前登录供应商ID
  24. * @var
  25. */
  26. protected $supplierId;
  27. /**
  28. * 当前登录供应商信息
  29. * @var
  30. */
  31. protected $supplierInfo;
  32. /**
  33. * 当前管理员权限
  34. * @var array
  35. */
  36. protected $auth = [];
  37. /**
  38. * 初始化
  39. */
  40. protected function initialize()
  41. {
  42. $this->supplierId = $this->request->hasMacro('supplierId') ? $this->request->supplierId() : 0;
  43. $this->supplierInfo = $this->request->hasMacro('supplierInfo') ? $this->request->supplierInfo() : [];
  44. $this->auth = $this->supplierInfo['rule'] ?? [];
  45. }
  46. }