From 8ba170debe8d340607ed9292ffffb8b77c48ffbb Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 21 Dec 2020 13:43:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8E=88=E6=9D=83=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/wechat/service/WechatService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/wechat/service/WechatService.php b/app/wechat/service/WechatService.php index ba59d52f7..64b619486 100644 --- a/app/wechat/service/WechatService.php +++ b/app/wechat/service/WechatService.php @@ -267,10 +267,10 @@ class WechatService extends Service $this->app->session->set("{$appid}_openid", $openid = $result['openid']); $this->app->session->set("{$appid}_fansinfo", $userinfo = $result['fans']); if ((empty($isfull) && !empty($openid)) || (!empty($isfull) && !empty($openid) && !empty($userinfo))) { - if (!empty($userinfo)) FansService::instance()->set($userinfo, $appid); + empty($userinfo) || FansService::instance()->set($userinfo, $appid); return ['openid' => $openid, 'fansinfo' => $userinfo]; } - if ($redirect && !empty($result['url'])) { + if ($redirect) { throw new HttpResponseException(redirect($result['url'], 301)); } else { throw new HttpResponseException(response("location.href='{$result['url']}'"));