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