From a282acc437677a704631d4de997720ab587512e0 Mon Sep 17 00:00:00 2001 From: hgc Date: Sat, 22 Feb 2025 20:18:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E8=BF=99=E4=B8=AA=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E7=94=A8=E6=88=B7=E5=90=8D=E4=B8=8B=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=BB=BB=E4=BD=95=E5=B9=BF=E5=91=8A=E8=B4=A6=E5=8F=B7=20?= =?UTF-8?q?=E5=88=99=E8=A7=A3=E7=BB=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/OAuthController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controller/OAuthController.php b/app/controller/OAuthController.php index 3ecddbc..d409a6a 100644 --- a/app/controller/OAuthController.php +++ b/app/controller/OAuthController.php @@ -110,13 +110,15 @@ class OAuthController try { $listAccessibleCustomers = $this->googleAdsAccountService->runListAccessibleCustomers($option); }catch (\Exception $e) { - return $this->errorResponse(300, 'The Google account (@gmail.com user) that generated the OAuth access tokens is not associated with any Ads accounts. Create a new account, or add the Google account to an existing Ads account.'); + $googleOAuthService = new GoogleOAuthService(); + $googleOAuthService->revokeToken($tokens['refresh_token'], $merchantId); + return $this->errorResponse(300, 'The Google account not associated with any Ads accounts'); } if (empty($listAccessibleCustomers)) { $googleOAuthService = new GoogleOAuthService(); $googleOAuthService->revokeToken($tokens['refresh_token'], $merchantId); - return $this->errorResponse(300, 'The Google account (@gmail.com user) that generated the OAuth access tokens is not associated with any active Ads accounts. Create a active account and try again.'); + return $this->errorResponse(300, 'The Google account not associated with any active Ads accounts'); } // $googleOAuthService->saveRefreshToken($tokens['refresh_token'], $state); //作废2025-2-13