SystemController.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * SystemController.php UTF-8
  4. *
  5. *
  6. * @date : 2018/6/20 9:49
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : luowei <lw@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace api\wapapp\controller\v8;
  13. use api\common\controller\V2ApiBaseController;
  14. use huo\controller\game\Game;
  15. use huo\controller\member\Oauth;
  16. use huo\controller\notice\Notice;
  17. use think\Session;
  18. class SystemController extends V2ApiBaseController {
  19. public function _initialize() {
  20. parent::_initialize();
  21. }
  22. /**
  23. * 初始化
  24. * http://doc.1tsdk.com/138?page_id=3556
  25. * 【域名】/system/appinit
  26. */
  27. public function appinit() {
  28. $_game_rq = $this->setGameData();
  29. $_channel_rq = $this->setChannelData();
  30. $_device_rq = $this->setDeviceData();
  31. $_game_class = new Game();
  32. $_rdata['up_info'] = $_game_class->getUpInfo($_game_rq, $_channel_rq);
  33. $_notice_class = new Notice();
  34. $_rdata['notice'] = $_notice_class->getNotice($_game_rq, $_channel_rq, $_device_rq);
  35. $_rdata['hb_time'] = 120;
  36. $_rdata['user_token'] = session_id();
  37. $_rdata['toggle'] = 1;// TODO: wuyonghong 2018/4/24 需要添加函数
  38. $_rdata['agentgame'] = $_channel_rq->getAgentGame();
  39. $_rdata['oauth_list'] = (new Oauth())->getOauthConf();
  40. $_rdata['help'] = [
  41. 'qq' => '',
  42. 'qqgroup' => '',
  43. 'wx' => '',
  44. 'tel' => '',
  45. 'servicetime' => '',
  46. ];// TODO: luowei 2018/6/20 未实现
  47. $_rdata['splash'] = [
  48. 'img' => '',
  49. 'gameid' => '',
  50. 'url' => '',
  51. ];// TODO: luowei 2018/6/20 未实现
  52. $_rdata['newmsg'] = 1;// TODO: luowei 2018/6/20 未实现
  53. $_open_cnt = isset($this->rq_data['open_cnt']) ? $this->rq_data['open_cnt'] : 1;
  54. Session::set('open_cnt', $_open_cnt);
  55. Session::set('app_id', $_game_rq->getHAppId(), 'app');
  56. $this->success(lang('SUCCESS'), $_rdata);
  57. }
  58. }