Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
yes
bulaienaofutuojiesenzhang904b5db72eb2
diff --git a/src/components/PublishDialog/index.tsx b/src/components/PublishDialog/index.tsxindex dba3c14f..8c8d335f 100644--- a/src/components/PublishDialog/index.tsx+++ b/src/components/PublishDialog/index.tsx@@ -322,6 +322,14 @@ const PublishDialog = memo(}}, [accounts, open]);+ // 离线账号(status === 0)不可参与发布:如被默认选中则自动移除+ useEffect(() => {+ const filtered = pubListChoosed.filter((item) => item.account.status !== 0);+ if (filtered.length !== pubListChoosed.length) {+ setPubListChoosed(filtered);+ }+ }, [pubListChoosed, setPubListChoosed]);+// 关闭弹框并确认关闭const closeDialog = useCallback(() => {confirm({@@ -551,6 +559,7 @@ const PublishDialog = memo(const isChoosed = pubListChoosed.find((v) => v.account.id === pubItem.account.id,);+ const isOffline = pubItem.account.status === 0;return (<div@@ -568,6 +577,10 @@ const PublishDialog = memo(key={pubItem.account.id}onClick={(e) => {e.stopPropagation();+ if (isOffline) {+ message.warning("该账号已离线,无法发布");+ return;+ }const newPubListChoosed = [...pubListChoosed];// 查找当前账户是否已被选择const index = newPubListChoosed.findIndex(@@ -608,12 +621,34 @@ const PublishDialog = memo(setPubListChoosed(newPubListChoosed);}}>- <AvatarPlat- className={`publishDialog-con-acconts-item-avatar ${!isChoosed ? 'disabled' : ''}`}- account={pubItem.account}- size="large"- disabled={!isChoosed}- />+ {/* 账号头像:离线显示遮罩并禁用 */}+ <div style={{ position: "relative" }}>+ <AvatarPlat+ className={`publishDialog-con-acconts-item-avatar ${!isChoosed || isOffline ? 'disabled' : ''}`}+ account={pubItem.account}+ size="large"+ disabled={isOffline || !isChoosed}+ />+ {isOffline && (+ <div+ style={{+ position: "absolute",+ inset: 0,+ background: "rgba(0,0,0,0.45)",+ borderRadius: "50%",+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ color: "#fff",+ fontSize: 12,+ fontWeight: 600,+ pointerEvents: "none",+ }}+ >+ 已离线+ </div>+ )}+ </div></div>);})}diff --git a/src/components/common/DownloadAppModal.tsx b/src/components/common/DownloadAppModal.tsxindex 4c99cf64..dc0ffb28 100644--- a/src/components/common/DownloadAppModal.tsx+++ b/src/components/common/DownloadAppModal.tsx@@ -2,7 +2,7 @@ import React, { useState } from 'react';import { Modal, Button, Space, Typography, message } from 'antd';import { DownloadOutlined, QrcodeOutlined, CopyOutlined, CheckOutlined } from '@ant-design/icons';import { useTransClient } from '@/app/i18n/client';-import { MAIN_APP_DOWNLOAD_URL } from '@/app/config/appDownloadConfig';+import { MAIN_APP_DOWNLOAD_URL, getMainAppDownloadUrl } from '@/app/config/appDownloadConfig';import logo from '@/assets/images/logo.png';import { QRCode } from 'react-qrcode-logo';@@ -35,12 +35,12 @@ const DownloadAppModal: React.FC<DownloadAppModalProps> = ({const [copySuccess, setCopySuccess] = useState(false);const handleDownload = () => {- const linkToOpen = downloadUrl || MAIN_APP_DOWNLOAD_URL;+ const linkToOpen = downloadUrl || getMainAppDownloadUrl();window.open(linkToOpen, '_blank');};const handleCopyLink = async () => {- const linkToCopy = downloadUrl || MAIN_APP_DOWNLOAD_URL;+ const linkToCopy = downloadUrl || getMainAppDownloadUrl();try {await navigator.clipboard.writeText(linkToCopy);setCopySuccess(true);@@ -116,7 +116,7 @@ const DownloadAppModal: React.FC<DownloadAppModalProps> = ({/>) : (<QRCode- value={downloadUrl || MAIN_APP_DOWNLOAD_URL}+ value={downloadUrl || getMainAppDownloadUrl()}size={120}logoImage={logo.src}logoWidth={30}@@ -155,7 +155,7 @@ const DownloadAppModal: React.FC<DownloadAppModalProps> = ({textAlign: 'left'}}>- {downloadUrl || MAIN_APP_DOWNLOAD_URL}+ {downloadUrl || getMainAppDownloadUrl()}</Text><Buttonsize="small"