<?php
namespace app\admin\controller;
use app\admin\controller\AuthBase;

use app\common\utils\HttpHelper;
use think\Controller;
use app\common\model\User as UserModel;

use think\Loader;

Loader::import('requests/library/Requests', EXTEND_PATH);


require_once EXTEND_PATH.'phpseclib/Crypt/RSA.php';

class Test extends AuthBase
{
    public function _initialize()
    {
        parent::_initialize();
    }
    

    // 获取AccessToken：http://ysj.imgondar.com/admin/Test/access_token
    public function access_token(){
        $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".config('wechat.appid')."&secret=".config('wechat.appsecret');
        $params = [
            "grant_type" => "client_credential",
            "appid" => config('wechat.appid'),
            "secret" => config('wechat.appsecret'),
        ];
        $request = \Requests::get($url);
        echo $request->body; exit;
    }


}