예제 #1
0
 protected function _init()
 {
     $access_token = I("get.access_token");
     if (empty($access_token)) {
         $access_token = I("post.access_token");
         unset($_POST['access_token']);
     }
     if (empty($access_token)) {
         $this->apiReturnErr("缺失access_token!");
     }
     $_GET['access_token'] = $access_token;
     //TODO: 对POST过来的传输数据进行解密,并将解密后的数据放入$_POST变量中
     //        if(APP_DEBUG){
     //            addLog("Api/_init",$_GET,$_POST,"基类验证!");
     //        }
     $resCtrl = new ResourceController();
     $result = $resCtrl->authorize();
     if ($result['status'] !== 0) {
         $this->apiReturnErr($result['info'], $result['status']);
     }
     $result = apiCall(AccessTokensApi::GET_INFO, array(array('access_token' => $access_token)));
     if ($result['status']) {
         $this->client_id = $result['info']['client_id'];
     }
     //        $this->decodePost();
     $this->getConfig();
 }
 protected function _init()
 {
     $access_token = I("get.access_token");
     if (empty($access_token)) {
         $access_token = I("post.access_token");
     }
     if (empty($access_token)) {
         $this->apiReturnErr("缺失access_token!");
     }
     $_GET['access_token'] = $access_token;
     //TODO: 对传输数据进行解密
     //        $data = $_POST['data'];
     //        $_POST = array_merge($_POST,$data);
     $resCtrl = new ResourceController();
     $result = $resCtrl->authorize();
     if ($result['status'] !== 0) {
         $this->apiReturnErr($result['info']);
     }
 }
 protected function _init()
 {
     $access_token = I("get.access_token");
     if (empty($access_token)) {
         $access_token = I("post.access_token");
     }
     if (empty($access_token)) {
         $this->apiReturnErr("缺失access_token!");
     }
     $_GET['access_token'] = $access_token;
     //TODO: 对POST过来的传输数据进行解密,并将解密后的数据放入$_POST变量中
     $resCtrl = new ResourceController();
     $result = $resCtrl->authorize();
     if ($result['status'] !== 0) {
         $this->apiReturnErr($result['info'], $result['status']);
     }
     $result = apiCall(AccessTokensApi::GET_INFO, array(array('access_token' => $access_token)));
     if ($result['status']) {
         $this->client_id = $result['info']['client_id'];
     }
 }