<?php namespace Phpcmf\Controllers\Admin;

// 已发布内容
class Article extends \Phpcmf\Common
{

    public function __construct() {
        parent::__construct();
        \Phpcmf\Service::V()->assign('menu', \Phpcmf\Service::M('auth')->_admin_menu(
            [
                WEIXIN_MORE_NAME.'已发布内容' => [APP_DIR.'/article/index', 'fa fa-envelope-o'],
            ]
        ));
    }

    public function index() {

        $rt = weixin_get_access_token();
        if (!$rt['code']) {
            $this->_admin_msg(0, $rt['msg']);
        }
        $access_token = $rt['msg'];
        $rt = wx_post_https_json_data(
            'https://api.weixin.qq.com/cgi-bin/freepublish/batchget?access_token='.$access_token,
            [
                'offset' => 0,
                'count' => 2,
                'no_content' => 0,
            ]
        );

        var_dump($rt);
    }


}
