Skip to content

Let's use AI to Earn!

账号过滤

daoyianfa4526be1887
diff --git a/src/views/account/components/AccountSidebar/AccountSidebar.tsx b/src/views/account/components/AccountSidebar/AccountSidebar.tsx
index 152505c6..87c15a5a 100644
--- a/src/views/account/components/AccountSidebar/AccountSidebar.tsx
+++ b/src/views/account/components/AccountSidebar/AccountSidebar.tsx
@@ -1,4 +1,4 @@
-import { ForwardedRef, forwardRef, memo, useRef, useState } from 'react';
+import { ForwardedRef, forwardRef, memo, useRef, useState, useMemo } from 'react';
import styles from './AccountSidebar.module.scss';
import { AccountInfo, AccountPlatInfoMap } from '../../comment';
import { Avatar, Button, message, Popover } from 'antd';
@@ -24,6 +24,8 @@ export interface IAccountSidebarProps {
activeAccountId: number;
// 切换选择的账户
onAccountChange: (info: AccountInfo) => void;
+ // 排除的平台类型
+ excludePlatforms?: string[];
}
const AccountPopoverInfo = ({ accountInfo }: { accountInfo: AccountInfo }) => {
@@ -103,18 +105,23 @@ const AccountPopoverInfo = ({ accountInfo }: { accountInfo: AccountInfo }) => {
const AccountSidebar = memo(
forwardRef(
(
- { activeAccountId, onAccountChange }: IAccountSidebarProps,
+ { activeAccountId, onAccountChange, excludePlatforms = [] }: IAccountSidebarProps,
ref: ForwardedRef<IAccountSidebarRef>,
) => {
const [isAccountModalOpen, setIsAccountModalOpen] = useState(false);
const pubAccountDetModuleRef = useRef<IPubAccountDetModuleRef>(null);
- const { accountList, getAccountList } = useAccountStore(
+ const { accountList: fullAccountList, getAccountList } = useAccountStore(
useShallow((state) => ({
accountList: state.accountList,
getAccountList: state.getAccountList,
})),
);
+ // 在组件内部过滤账号列表,而不是在 useAccountStore 中过滤
+ const accountList = useMemo(() => {
+ return fullAccountList.filter(account => !excludePlatforms.includes(account.type));
+ }, [fullAccountList, excludePlatforms]);
+
return (
<>
<PubAccountDetModule
diff --git a/src/views/replyother/replyother.tsx b/src/views/replyother/replyother.tsx
index 6b2f7cbd..81c15831 100644
--- a/src/views/replyother/replyother.tsx
+++ b/src/views/replyother/replyother.tsx
@@ -141,9 +141,9 @@ export default function Page() {
// 获取进程中互动信息
const getRunningInteractions = async () => {
try {
- console.log('------ 开始获取进程中互动信息');
+ // console.log('------ 开始获取进程中互动信息');
const res = await ipcGetAutoRunOfInteractionInfo();
- console.log('------ 获取进程中互动信息结果:', res);
+ // console.log('------ 获取进程中互动信息结果:', res);
if (res) {
setRunningInteractions([{ ...res }]);
}else{
@@ -151,7 +151,7 @@ export default function Page() {
}
} catch (error) {
- console.error('------ 获取进程中互动信息失败:', error);
+ // console.error('------ 获取进程中互动信息失败:', error);
message.error('获取进程中互动信息失败');
}
};
@@ -701,6 +701,7 @@ export default function Page() {
<div style={{ display: 'flex', flexDirection: 'row', height: '100%' }}>
<AccountSidebar
activeAccountId={activeAccountId}
+ excludePlatforms={['wxSph']}
onAccountChange={useCallback(
(info) => {
console.log('------ onAccountChange', info);