1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Ksh
- * Date: 2017/6/26
- * Time: 11:12
- */
- namespace api\oa\controller;
- use think\Db;
- class OaAdminController extends OacallbackController {
- function _initialize() {
- parent::_initialize();
- $this->checkParam();
- $this->jumpToLogin();
- }
- public function index() {
- }
- function checkParam() {
- $this->checkTc();
- $this->checkData();
- $this->checkGroupId();
- }
- function checkTc() {
- if (empty($this->param['tc'])) {
- exit;
- }
- }
- function checkData() {
- if (empty($this->param['data'])) {
- exit;
- }
- }
- function checkGroupId() {
- if (empty($this->param['group_id'])) {
- exit;
- }
- }
- public function jumpToLogin() {
- $_group_id = $this->param['group_id'];
- $_tc = $this->param['tc'];
- $_data = $this->param['data'];
- $_group_id = $this->param['group_id'];
- $_role_id = $this->oa_class->nodeGroupToRole($_group_id);
- if (!$_role_id) {
- exit;
- }
- if ((new \huolib\oa\Oa())::SDK_ADMIN_ROLE_ID == $_role_id) {
- header('location:'.ADMINSITE.'/admin/public/jump.html?tc='.$_tc.'&data='.$_data.'&group_id='.$_group_id);
- exit;
- } elseif ((new \huolib\oa\Oa())::SDK_LEGION_ROLE_ID == $_role_id
- || (new \huolib\oa\Oa())::SDK_PROMOTER_ROLE_ID == $_role_id
- ) {
- header('location:'.AGENTSITE.'/agent/login?tc='.$_tc.'&data='.$_data.'&group_id='.$_group_id);
- exit;
- }
- }
- }
|