BaseStoreApi.php 894 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 上海牛之云网络科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * =========================================================
  9. */
  10. namespace addon\store\shopapi\controller;
  11. use app\shopapi\controller\BaseApi;
  12. class BaseStoreApi extends BaseApi
  13. {
  14. protected $store_id;
  15. public function __construct()
  16. {
  17. //执行父类构造函数
  18. parent::__construct();
  19. $token = $this->checkToken();
  20. if ($token['code'] != 0) exit($this->response($token));
  21. if ($this->app_module != 'store') exit($this->response($this->error([], 'NO_PERMISSION')));
  22. $this->store_id = $this->user_info['site_id'];
  23. }
  24. }