From bb0806e856d1243e4b608727b6eac0c52bd661c5 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sun, 7 Apr 2024 20:21:53 +0800 Subject: [PATCH] 1 --- app/common/library/wxserver/Server.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/common/library/wxserver/Server.php b/app/common/library/wxserver/Server.php index da149860..3b35f834 100644 --- a/app/common/library/wxserver/Server.php +++ b/app/common/library/wxserver/Server.php @@ -123,8 +123,8 @@ class Server $data['component_appid'] = self::APPID; $data['authorization_code'] = $authorization_code; $result = $this->curlPost($url, json_encode($data)); + Db::table('yoshop_wx_server')->insertGetId(['content' => $result, 'created_at' => date('Y-m-d H:i:s')]); $result = json_decode($result, true); - Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($result), 'created_at' => date('Y-m-d H:i:s')]); if ($result && !empty($result['authorization_info']) && !empty($result['authorization_info']['authorizer_appid'])) { Db::table('yoshop_wx_server')->insertGetId(['content' => '获取详情' . $authorization_code, 'created_at' => date('Y-m-d H:i:s')]); $url = 'https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info?component_access_token=' . $this->getComponentAccessToken(); @@ -132,8 +132,8 @@ class Server $data['component_appid'] = self::APPID; $data['authorizer_appid'] = $result['authorization_info']['authorizer_appid']; $res = $this->curlPost($url, json_encode($data)); + Db::table('yoshop_wx_server')->insertGetId(['content' => $res, 'created_at' => date('Y-m-d H:i:s')]); $res = json_decode($res, true); - Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($res), 'created_at' => date('Y-m-d H:i:s')]); if ($res && !empty($res['authorizer_info']) && !empty($res['authorization_info'])) { $authorizer_info = $res['authorizer_info']; $authorization_info = $res['authorization_info'];