Browse Source

社媒对facebook

moshaorui 2 days ago
parent
commit
accc3b7782
2 changed files with 5 additions and 11 deletions
  1. 3 3
      app/Services/Smm/FacebookService.php
  2. 2 8
      composer.lock

+ 3 - 3
app/Services/Smm/FacebookService.php

@@ -15,7 +15,7 @@ class FacebookService implements SmmPlatformInterface
         $this->fb = new Facebook([
             'app_id' => env('SSM_FACEBOOK_APP_ID'), // 替换为您的App ID
             'app_secret' => env('SSM_FACEBOOK_APP_SECRET'), // 替换为您的App Secret
-            'default_graph_version' => 'v12.0', // 使用当前版本
+            'default_graph_version' => 'v22.0', // 使用当前版本
         ]);
         //$this->pageAccessToken = $pageAccessToken;
     }
@@ -28,9 +28,9 @@ class FacebookService implements SmmPlatformInterface
     {
         // 实现Facebook登录逻辑
         $helper = $this->fb->getRedirectLoginHelper();
-        $permissions = ['publish_pages'];
+        $permissions = ['public_profile','email'];
         $distSiteUrl = env('DIST_SITE_URL');
-        $loginUrl = $helper->getLoginUrl($distSiteUrl.'/callback/facebook', $permissions);
+        $loginUrl = $helper->getLoginUrl('https://internal-dist.mietubl.com.cn/callback/facebook', $permissions);
         return ['status'=>true, 'data' => ['url'=>$loginUrl]];
     }
 

+ 2 - 8
composer.lock

@@ -1059,13 +1059,7 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/facebook/php-graph-sdk/zipball/38fd7187a6704d3ab14ded2f3a534ac4ee6f3481",
                 "reference": "38fd7187a6704d3ab14ded2f3a534ac4ee6f3481",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
+                "shasum": ""
             },
             "require": {
                 "ext-mbstring": "*",
@@ -9079,5 +9073,5 @@
         "php": "^8.0.2"
     },
     "platform-dev": [],
-    "plugin-api-version": "2.6.0"
+    "plugin-api-version": "2.2.0"
 }