<?php
/**
 * User: liuyuzhen
 * Date: 2018/5/24
 * Time: 15:17
 * Description:
 */
class  ThirdplatformController extends \Our\Controller_AbstractIndex {

    public function init(){
        parent::init();
    }

    /**
     * 第三方平台授权获取授权信息
     * @throws Exception
     */
    public function getAuthInfoAction(){
        $thirdplatformService = \Business\User\ThirdplatformServiceModel::getInstance();
        $where = $this->req[\Our\NameConst::data];
        $data = $thirdplatformService->getAuthInfo($where);
        if($data){
            $this->success($data);
        }
        \Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongPlatformInfo);
    }


    public function wechatAppAuthAction(){
        $thirdplatformService = \Business\User\ThirdplatformServiceModel::getInstance();
        $where = $this->req[\Our\NameConst::data];
        $data = $thirdplatformService->wechatAppAuth($where);
        if($data['status']){
            $this->success(array());
        }
        \Error\ErrorModel::throwException(\Error\CodeConfigModel::wxUserInfoAuthError);
    }
}