Skip to content

Let's use AI to Earn!

feat: 选择账户组件默认平台选择逻辑处理

gaoSira772e8a9b821
diff --git a/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx b/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx
index 9769b9de..5fb41792 100644
--- a/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx
+++ b/src/views/publish/components/ChooseAccountModule/components/PlatChoose.tsx
@@ -118,7 +118,16 @@ const PlatChoose = memo(
newMap.get(v.type)?.push(v);
});
// 默认平台
- setActivePlat((Array.from(newMap)[0] || [])[0]);
+ if (!activePlat) {
+ for (const [accountType, accountList] of Array.from(newMap)) {
+ if (
+ accountList.length !== 0 &&
+ (allowPlatSet ? allowPlatSet.has(accountType) : true)
+ ) {
+ setActivePlat(accountType);
+ }
+ }
+ }
return newMap;
});
});
diff --git a/src/views/task/components/videoInfo.tsx b/src/views/task/components/videoInfo.tsx
index 74745d1f..6df2899e 100644
--- a/src/views/task/components/videoInfo.tsx
+++ b/src/views/task/components/videoInfo.tsx
@@ -197,7 +197,6 @@ const Com = forwardRef<TaskInfoRef>((props: any, ref) => {
onClose={() => !downloading && setChooseAccountOpen(false)}
choosedAccounts={accountListChoose}
onPlatConfirm={async (aList) => {
- console.log('选择的账号:', aList);
setAccountListChoose(aList);
// 下载文件并发布