Base.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: qisse
  5. * Date: 2017/6/7
  6. * Time: 7:36
  7. */
  8. namespace app\mobile\logic;
  9. use app\core\exception\AppException;
  10. use think\Config;
  11. use think\Request;
  12. class Base
  13. {
  14. protected $user;
  15. protected $app;
  16. protected $data;
  17. protected $platform;
  18. protected $request;
  19. protected $skin;
  20. public function __construct(Request $request) {
  21. $this->request = $request;
  22. $this->user = isset($request->user) ? $request->user : null;
  23. $this->app = isset($request->app) ? $request->app : [];
  24. $this->data = isset($request->data) ? $request->data : [];
  25. $this->platform = Config::get('platform.default_check_gateway');
  26. $this->skin = Config::get('skin_channel'.'.app_skin_config');
  27. if($this->data['osType'] == 1) {
  28. $this->skin = Config::get('skin_channel_'.$this->data['channel'].'.app_skin_config');
  29. }
  30. //$this->_initialize();
  31. }
  32. public function map() {
  33. $map['userID'] = $this->user['userID'];
  34. return $map;
  35. }
  36. public function h5RootUrl() {
  37. return Config::get('h5RootUrl');
  38. }
  39. /*public function checkMember($memberID = '') {
  40. if($this->member['id'] != $memberID) {
  41. throw new AppException(-7778, '没有权限');
  42. }
  43. }*/
  44. }