From 05fc330d934f7226706401dd977004488d19ef21 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 1 Sep 2023 16:26:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=85=B3=E8=81=94=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 2e3a95ed..d8d25cd1 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -218,6 +218,19 @@ class Auth extends BaseController $data['community_num'] = Db::name('community')->where('uid', $user->uid)->whereIn('is_type', '1,2')->count(); $thirdparty = Db::name('user_thirdparty_token')->where('user_id', $user->uid)->select(); + $thirdList = []; + foreach($thirdparty as $v) { + $temp = [ + 'account' => $v['account'], + 'user_type' => $v['user_type'], + 'token' => $v['token'] + ]; + if ($v['expires_time'] <= date('Y-m-d H:i:s')) { + $temp['token'] = ''; + } + $thirdList[] = $temp; + } + $data['thirdparty'] = $thirdList; return app('json')->success($data); }