瀏覽代碼

[edit] share facebook

wenliming 2 年之前
父節點
當前提交
31c6110123
共有 2 個文件被更改,包括 21 次插入2 次删除
  1. 8 1
      src/logic/content/twitter.js
  2. 13 1
      src/view/iframe/red-packet/red-packet.vue

+ 8 - 1
src/logic/content/twitter.js

@@ -73,7 +73,14 @@ export function hideIframeHandler() {
  * 展示twitter原生发布框
  */
 export function showTwitterPublishDialogHandler(publishRes) {
-    dom.tweetBtn.click();
+    let bigBtn = document.querySelector('a[data-testid="SideNav_NewTweet_Button"]');
+    if(bigBtn) {
+        bigBtn.click();
+    } else {
+        let smallBtn = document.querySelector('a[href="/compose/tweet"]')
+        smallBtn && smallBtn.click();
+    }
+
     _setPublishContent(publishRes.srcContent);
     _publishTweetEvent(publishRes.postId, bindTwitterArtMethod);
 }

+ 13 - 1
src/view/iframe/red-packet/red-packet.vue

@@ -319,6 +319,7 @@ import Report from "@/log-center/log"
 import { srcPublishSuccess } from '@/http/publishApi'
 import { discordAuthUrl, checkGuildJoined } from '@/http/discordApi'
 import { discordAuthRedirectUri, faceShareRedirectUrl} from '@/http/configAPI'
+import { getFrontConfig } from "@/http/account";
 
 var moment = require('moment');
 
@@ -327,7 +328,7 @@ let joinDiscordActionState = 'default'; //authAndJoinIng  joinIng  reAuth
 let joinDiscordIng = ref(false);
 
 let facebookAppConfig = {
-  facebookAppId: "1040829453198385",
+  facebookAppId: "",
   faceShareRedirectUrl
 };
 
@@ -789,9 +790,20 @@ const handleStatusPage = () => {
 
 }
 
+function setFrontConfig() {
+    getFrontConfig({
+        params: {},
+    }).then((res) => {
+        if (res.code == 0) {
+            facebookAppConfig.facebookAppId = res.data.fbClientId;
+        }
+    });
+};
+
 function init() {
   onRuntimeMsg();
   onPageVisbile();
+  setFrontConfig();
   getPostDetail({
     params: {
       postId: state.postId