AuthController.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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\store;
  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. * 门店整体类型0:平台1:门店2:供应商
  24. * @var int
  25. */
  26. protected $type = 1;
  27. /**
  28. * 当前登录门店信息
  29. * @var
  30. */
  31. protected $storeInfo;
  32. /**
  33. * 当前登门店ID
  34. * @var
  35. */
  36. protected $storeId;
  37. /**
  38. * 当前登录门店店员ID
  39. * @var
  40. */
  41. protected $storeStaffId;
  42. /**
  43. * 当前登录门店店员信息
  44. * @var
  45. */
  46. protected $storeStaffInfo;
  47. /**
  48. * 当前管理员权限
  49. * @var array
  50. */
  51. protected $auth = [];
  52. /**
  53. * 初始化
  54. */
  55. protected function initialize()
  56. {
  57. $this->storeId = $this->request->hasMacro('storeId') ? $this->request->storeId() : 0;
  58. $this->storeStaffId = $this->request->hasMacro('storeStaffId') ? $this->request->storeStaffId() : 0;
  59. $this->storeStaffInfo = $this->request->hasMacro('storeStaffInfo') ? $this->request->storeStaffInfo() : [];
  60. $this->auth = $this->storeStaffInfo['rule'] ?? [];
  61. }
  62. }