...
|
...
|
@@ -16,17 +16,10 @@ use app\portal\service\ToolsService; |
|
|
|
|
|
class AdminPostController extends AdminBaseController
|
|
|
{
|
|
|
protected $appid;
|
|
|
protected $app_secret;
|
|
|
public function __construct()
|
|
|
{
|
|
|
$this->appid = config('app_id');
|
|
|
$this->app_secret = config('app_secret');
|
|
|
}
|
|
|
|
|
|
public function getAccessToken()
|
|
|
{
|
|
|
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $this->appid . '&secret=' . $this->app_secret;
|
|
|
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . config('app_id') . '&secret=' . config('app_secret');
|
|
|
$html = file_get_contents($url);
|
|
|
$output = json_decode($html, true);
|
|
|
$access_token = $output['access_token'];
|
...
|
...
|
|