正在显示
1 个修改的文件
包含
1 行增加
和
8 行删除
@@ -16,17 +16,10 @@ use app\portal\service\ToolsService; | @@ -16,17 +16,10 @@ use app\portal\service\ToolsService; | ||
16 | 16 | ||
17 | class AdminPostController extends AdminBaseController | 17 | class AdminPostController extends AdminBaseController |
18 | { | 18 | { |
19 | - protected $appid; | ||
20 | - protected $app_secret; | ||
21 | - public function __construct() | ||
22 | - { | ||
23 | - $this->appid = config('app_id'); | ||
24 | - $this->app_secret = config('app_secret'); | ||
25 | - } | ||
26 | 19 | ||
27 | public function getAccessToken() | 20 | public function getAccessToken() |
28 | { | 21 | { |
29 | - $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $this->appid . '&secret=' . $this->app_secret; | 22 | + $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . config('app_id') . '&secret=' . config('app_secret'); |
30 | $html = file_get_contents($url); | 23 | $html = file_get_contents($url); |
31 | $output = json_decode($html, true); | 24 | $output = json_decode($html, true); |
32 | $access_token = $output['access_token']; | 25 | $access_token = $output['access_token']; |
-
请 注册 或 登录 后发表评论