From 12a431935ef7ab948feddcef9f2ca02b493d4079 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Wed, 25 Sep 2024 10:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0UGC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/User.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/api/controller/User.php b/app/api/controller/User.php index ece4f217..cc6f6290 100755 --- a/app/api/controller/User.php +++ b/app/api/controller/User.php @@ -9,9 +9,12 @@ use app\api\validate\UpdateUserValidate; use app\api\validate\SetWechatUserValidate; use app\api\validate\WechatMobileValidate; use app\api\validate\ChangeMobileValidate; +use app\common\server\WeChatServer; use think\exception\ValidateException; use app\common\server\UrlServer; use think\facade\Db; +use Requests; + class User extends Api { /*** @@ -43,6 +46,15 @@ class User extends Api }catch(ValidateException $e) { return JsonServer::error($e->getError()); } + + if ($post['ugc']) { + $config = WeChatServer::getOpWebConfig(); + $appid = $config['app_id']; + $secret = $config['secret']; + $result = Requests::get('https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $appid . '&secret=' . $secret); + dump($result);die; + } + $result = UserLogic::setUserInfo($post); if($result === true) { return JsonServer::success('设置成功');