|
@@ -1,5 +1,5 @@
|
|
import { fetchTtwitterRequestToken, fetchTwitterLogin, fetchTwitterShortUrl, fetchAllMessageInfo, fetchReadTaskAllMsg, getDiscordUserInfo, fetchGetTwitterNftPostPre, fetchPublish, fetchGetAllUnReadNotices } from '@/logic/background/fetch/twitter.js'
|
|
import { fetchTtwitterRequestToken, fetchTwitterLogin, fetchTwitterShortUrl, fetchAllMessageInfo, fetchReadTaskAllMsg, getDiscordUserInfo, fetchGetTwitterNftPostPre, fetchPublish, fetchGetAllUnReadNotices } from '@/logic/background/fetch/twitter.js'
|
|
-import { LANDING_PAGE, LANDING_PAGE_MID, setChromeStorage, setChromeCookie, getChromeCookie, getChromeStorage, removeChromeCookie, LANDING_PAGE_JUMP_INFO } from '@/uilts/chromeExtension.js'
|
|
|
|
|
|
+import { LANDING_PAGE, WEBSITE_USER_INFO, LANDING_PAGE_MID, setChromeStorage, setChromeCookie, getChromeCookie, getChromeStorage, removeChromeCookie, LANDING_PAGE_JUMP_INFO } from '@/uilts/chromeExtension.js'
|
|
import { guid } from '@/uilts/help.js'
|
|
import { guid } from '@/uilts/help.js'
|
|
import { discordAuthRedirectUri } from '@/http/configAPI'
|
|
import { discordAuthRedirectUri } from '@/http/configAPI'
|
|
import { setContentMessage } from '@/logic/background/help.js'
|
|
import { setContentMessage } from '@/logic/background/help.js'
|
|
@@ -88,6 +88,7 @@ export function twitterPinLoginCode(sender, code) {
|
|
fetchTwitterLogin(authToken, consumerKey, code, receivedIds).then(res => {
|
|
fetchTwitterLogin(authToken, consumerKey, code, receivedIds).then(res => {
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
setChromeStorage({ userInfo: JSON.stringify(res.data) })
|
|
setChromeStorage({ userInfo: JSON.stringify(res.data) })
|
|
|
|
+ setChromeCookie(WEBSITE_USER_INFO, res.data)
|
|
|
|
|
|
sendActivetabMessage({
|
|
sendActivetabMessage({
|
|
actionType: 'BG_LOGIN_SET_USERINFO_CB'
|
|
actionType: 'BG_LOGIN_SET_USERINFO_CB'
|
|
@@ -256,14 +257,14 @@ export function onInstalledCreateTab() {
|
|
Report.reportLog({
|
|
Report.reportLog({
|
|
objectType: Report.objectType.chrome_extension_installed,
|
|
objectType: Report.objectType.chrome_extension_installed,
|
|
funcName: 'onInstalledCreateTab',
|
|
funcName: 'onInstalledCreateTab',
|
|
- postId: res.postId || ''
|
|
|
|
|
|
+ postId: res?.postId || ''
|
|
})
|
|
})
|
|
}, 5000)
|
|
}, 5000)
|
|
-
|
|
|
|
|
|
+ let url = 'https://twitter.com/search?q=%23denet'
|
|
// jump_info
|
|
// jump_info
|
|
if (!res || !res.jump_type) {
|
|
if (!res || !res.jump_type) {
|
|
chrome.tabs.create({
|
|
chrome.tabs.create({
|
|
- url: "https://twitter.com",
|
|
|
|
|
|
+ url
|
|
});
|
|
});
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -273,7 +274,7 @@ export function onInstalledCreateTab() {
|
|
case 'red_packet':
|
|
case 'red_packet':
|
|
if (res && res.postNickName && res.srcContentId) {
|
|
if (res && res.postNickName && res.srcContentId) {
|
|
created_detail = true
|
|
created_detail = true
|
|
- let url = `https://twitter.com/${res.postNickName}/status/${res.srcContentId}`
|
|
|
|
|
|
+ url = `https://twitter.com/${res.postNickName}/status/${res.srcContentId}`
|
|
chrome.tabs.create({
|
|
chrome.tabs.create({
|
|
url
|
|
url
|
|
});
|
|
});
|
|
@@ -283,17 +284,17 @@ export function onInstalledCreateTab() {
|
|
case 'luck_draw':
|
|
case 'luck_draw':
|
|
if (res && res.postNickName && res.srcContentId) {
|
|
if (res && res.postNickName && res.srcContentId) {
|
|
created_detail = true
|
|
created_detail = true
|
|
- let url = `https://twitter.com/${res.postNickName}/status/${res.srcContentId}`
|
|
|
|
|
|
+ url = `https://twitter.com/${res.postNickName}/status/${res.srcContentId}`
|
|
chrome.tabs.create({
|
|
chrome.tabs.create({
|
|
url
|
|
url
|
|
});
|
|
});
|
|
}
|
|
}
|
|
break
|
|
break
|
|
// NFT
|
|
// NFT
|
|
- case 'ntf_info':
|
|
|
|
|
|
+ case 'nft_info':
|
|
if (res && res.twitterAccount && res.nftProjectId) {
|
|
if (res && res.twitterAccount && res.nftProjectId) {
|
|
created_detail = true
|
|
created_detail = true
|
|
- let url = `https://twitter.com/${res.twitterAccount}`
|
|
|
|
|
|
+ url = `https://twitter.com/${res.twitterAccount}`
|
|
chrome.tabs.create({
|
|
chrome.tabs.create({
|
|
url
|
|
url
|
|
});
|
|
});
|
|
@@ -310,8 +311,8 @@ export function onInstalledCreateTab() {
|
|
groupTabData: JSON.stringify({
|
|
groupTabData: JSON.stringify({
|
|
deTabVal: 'deGroupTab'
|
|
deTabVal: 'deGroupTab'
|
|
})
|
|
})
|
|
- }, (res) => {
|
|
|
|
- let url = `https://twitter.com/${res.twitterAccount}`
|
|
|
|
|
|
+ }, (response) => {
|
|
|
|
+ url = `https://twitter.com/${res.twitterAccount}`
|
|
chrome.tabs.create({
|
|
chrome.tabs.create({
|
|
url
|
|
url
|
|
});
|
|
});
|
|
@@ -322,7 +323,7 @@ export function onInstalledCreateTab() {
|
|
case 'tool_box':
|
|
case 'tool_box':
|
|
if (res && res.postNickName && res.srcContentId) {
|
|
if (res && res.postNickName && res.srcContentId) {
|
|
created_detail = true
|
|
created_detail = true
|
|
- let url = `https://twitter.com/${res.postNickName}/status/${res.srcContentId}`
|
|
|
|
|
|
+ url = `https://twitter.com/${res.postNickName}/status/${res.srcContentId}`
|
|
chrome.tabs.create({
|
|
chrome.tabs.create({
|
|
url
|
|
url
|
|
});
|
|
});
|
|
@@ -332,7 +333,7 @@ export function onInstalledCreateTab() {
|
|
|
|
|
|
if (created_detail == false) {
|
|
if (created_detail == false) {
|
|
chrome.tabs.create({
|
|
chrome.tabs.create({
|
|
- url: "https://twitter.com",
|
|
|
|
|
|
+ url
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|