Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
fix: 图文发布恢复发布记录后账号选择问题修复及抖音图文发布活动和热点参数兼容
gaoSirac425077e021
diff --git a/electron/plat/douyin/index.ts b/electron/plat/douyin/index.tsindex 4e103aa6..9084b256 100644--- a/electron/plat/douyin/index.ts+++ b/electron/plat/douyin/index.ts@@ -728,7 +728,7 @@ export class DouyinService {const response = {publishTime: Math.floor(Date.now() / 1000),publishId: publishResult.aweme.aweme_id,- shareLink: '',+ shareLink: `https://www.douyin.com/user/self?from_tab_name=main&modal_id=${publishResult.data.item_id}&showTab=post`,};console.log(`发布成功,返回数据:`, response);resolve(response);@@ -1669,11 +1669,11 @@ export class DouyinService {common: {// 活动activity: parmasDisposeOK.activity,+ // 挑战+ challenges: parmasDisposeOK.activity,text: parmasDisposeOK.text,item_title: parmasDisposeOK.item_title,text_extra: JSON.stringify(parmasDisposeOK.text_extra),- // 挑战- challenges: JSON.stringify([]),creation_id: '',// 是否允许下载download: 1,@@ -1796,6 +1796,7 @@ export class DouyinService {// 整合发布参数const publishParams = {+ hot_sentence: platformSetting.hot_sentence,item_title: platformSetting['title'] ?? '',text,text_extra: textExtra,diff --git a/src/views/publish/children/imagePage/components/ImageRightSetting/ImageRightSetting.tsx b/src/views/publish/children/imagePage/components/ImageRightSetting/ImageRightSetting.tsxindex 7f44cdc1..cc5ed400 100644--- a/src/views/publish/children/imagePage/components/ImageRightSetting/ImageRightSetting.tsx+++ b/src/views/publish/children/imagePage/components/ImageRightSetting/ImageRightSetting.tsx@@ -39,6 +39,7 @@ const ImageRightSetting = memo(.map((v) => v.account).filter((v) => v !== undefined),pubType: PubType.ImageText,+ defaultPlat: activePlat,}}onPlatConfirm={(aList) => {addAccount(aList);diff --git a/src/views/publish/components/ChooseAccountModule/ChooseAccountModule.tsx b/src/views/publish/components/ChooseAccountModule/ChooseAccountModule.tsxindex 8afba3af..f088fd20 100644--- a/src/views/publish/components/ChooseAccountModule/ChooseAccountModule.tsx+++ b/src/views/publish/components/ChooseAccountModule/ChooseAccountModule.tsx@@ -21,7 +21,6 @@ export interface IChooseAccountModuleRef {export interface IChooseAccountModuleProps {open: boolean;onClose: (open: boolean) => void;-// 按平台propsplatChooseProps?: IPlatChooseProps;// 按平台选择确认diff --git a/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx b/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsxindex ee665478..ef99fc37 100644--- a/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx+++ b/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx@@ -41,6 +41,8 @@ export interface IPlatChooseRef {export interface IPlatChooseProps {pubType: PubType;+ // 默认选择的平台+ defaultPlat?: AccountType;onChange?: (choosedAcounts: AccountInfo[],choosedAcount: AccountInfo,@@ -65,6 +67,7 @@ const PlatChoose = memo(disableAllSelect = false,isCancelChooseAccount = false,allowPlatSet,+ defaultPlat,}: IPlatChooseProps,ref: ForwardedRef<IPlatChooseRef>,) => {@@ -100,7 +103,7 @@ const PlatChoose = memo(// 默认平台设置useEffect(() => {- setActivePlat(Array.from(accountMapLast.keys())[0]);+ setActivePlat(defaultPlat || Array.from(accountMapLast.keys())[0]);}, [accountMapLast]);// 所有平台的账户数据diff --git a/src/views/publish/components/CommonComponents/DouyinCommonComponents.tsx b/src/views/publish/components/CommonComponents/DouyinCommonComponents.tsxindex 03dcc464..9e04129e 100644--- a/src/views/publish/components/CommonComponents/DouyinCommonComponents.tsx+++ b/src/views/publish/components/CommonComponents/DouyinCommonComponents.tsx@@ -133,14 +133,14 @@ export const CommonActivitySelect = ({const init = () => {icpGetDouyinActivity(account).then((res) => {- setOptions(res.activity_list);+ setOptions(res.activity_list || []);});icpGetActivityTags(account).then((res) => {res.data?.query_tags?.map((v) => {activityTagsMap.current.set(v.id, v);});- setActivityTagList(res.data.query_tags);- setActivityTag(`${res.data.query_tags[0].id}`);+ setActivityTagList(res.data.query_tags || []);+ setActivityTag(`${res.data.query_tags[0]?.id}`);});};@@ -256,7 +256,7 @@ export const CommonActivitySelect = ({activeKey={activityTag}onChange={setActivityTag}type="card"- items={activityTagList.map((v) => {+ items={activityTagList?.map((v) => {return {key: `${v.id}`,label: v.name,@@ -264,7 +264,7 @@ export const CommonActivitySelect = ({})}/>{options- .filter((v) => v.query_tag === +activityTag)+ ?.filter((v) => v.query_tag === +activityTag).map((data) => {return (<div