qiushang 8 months ago
parent
commit
7c13f6c5c9
1 changed files with 4 additions and 2 deletions
  1. 4 2
      app/Http/Api/WechatOfficialController.php

+ 4 - 2
app/Http/Api/WechatOfficialController.php

@@ -241,7 +241,7 @@ class WechatOfficialController extends HttpBaseController
                     return "欢迎你关注助友办公软件";
                 } else {
                     $oauthUrl = $this->app->oauth->withState(base64_encode($sceneStr))->redirect();
-                    $oauthUrl = str_replace('https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1edb103f32029099&redirect_uri=https%3A%2F%2Fwww.qasimblog.com%2Fapi%2Fwechat%2FoauthCallback&response_type=code&scope=snsapi_userinfo&state=WHdCeXhSMW5vUHgzOjUyNDEzYTY3MWVjNzAzNDc4M2FhM', '', $oauthUrl);
+                    //$oauthUrl = str_replace('https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1edb103f32029099&redirect_uri=https%3A%2F%2Fwww.qasimblog.com%2Fapi%2Fwechat%2FoauthCallback&response_type=code&scope=snsapi_userinfo&state=WHdCeXhSMW5vUHgzOjUyNDEzYTY3MWVjNzAzNDc4M2FhMWEzMDMyNmRlMjNk&connect_redirect=1#wechat_redirect', '', $oauthUrl);
                     $items = [
                         new NewsItem([
                             'title' => '',
@@ -250,7 +250,7 @@ class WechatOfficialController extends HttpBaseController
                             'image' => 'https://www.qasimblog.com/static/login.jpg',
                         ]),
                         new NewsItem([
-                            'title' => $oauthUrl,
+                            'title' => '点击确认登录',
                             'description' => '',
                             'url' => $oauthUrl,
                             'image' => 'https://www.qasimblog.com/static/logo.png',
@@ -347,6 +347,8 @@ class WechatOfficialController extends HttpBaseController
         $oauth = $this->app->oauth;
         $user = $oauth->userFromCode($code);
 
+        Log::info('22222222222222222222222 === ' . 'code' . $code . ' ==== ' . $user);
+
         $openid = $user->getId();// 对应微信的 OPENID
         $nickname = $user->getNickname(); // 对应微信的 nickname
         $avatar = $user->getAvatar(); // 头像网址