Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
缺少视频号,小红书是全球平台,不局限于中国ip,在web上要提示去下载app使用
daoyiane09716feb429
diff --git a/@types/resources.d.ts b/@types/resources.d.tsindex bd3007bf..405c7968 100644--- a/@types/resources.d.ts+++ b/@types/resources.d.ts@@ -65,6 +65,27 @@ interface Resources {"success": "新建空间成功","failed": "新建空间失败","nameRequired": "请输入空间名称"+ },+ "locationRestriction": {+ "cnSpace": "当前空间为中国属地,仅显示国内平台",+ "nonCnSpace": "当前空间为非中国属地,国内平台暂不可用"+ },+ "userManageSidebar": {+ "allAccounts": "全部账号",+ "spaces": "空间",+ "createSpace": "新建空间",+ "spaceNamePlaceholder": "请输入空间名称",+ "cannotOperateDefault": "不能操作默认列表",+ "rename": "重命名",+ "delete": "删除",+ "confirmDelete": "提示",+ "confirmDeleteContent": "请确认是否删除列表:",+ "deleteSuccess": "删除成功",+ "createSpaceTitle": "新建空间",+ "renameSpaceTitle": "重命名空间",+ "cancel": "取消",+ "save": "保存",+ "spaceName": "空间名"}},"cgmaterial": {@@ -233,6 +254,17 @@ interface Resources {"materialLibrary": "素材库","draftBox": "草稿箱"},+ "downloadApp": {+ "title": "下载{{appName}}",+ "operationInApp": "请在{{appName}}中操作添加",+ "description": "为了更好的用户体验和功能完整性,该操作需要在 {{appName}} 中完成账号添加。请下载并安装 {{appName}} 后继续操作。",+ "scanQrCode": "扫描二维码下载",+ "downloadLink": "下载链接:",+ "copy": "复制",+ "close": "关闭",+ "downloadNow": "立即下载",+ "tip": "💡 提示:安装完成后,请在App中登录您的账号,然后重新尝试相关操作"+ },"signIn": {"title": "每日签到得积分","myPoints": "我的积分",diff --git a/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.module.scss b/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.module.scssindex 36d93671..da1ab0b8 100644--- a/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.module.scss+++ b/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.module.scss@@ -356,6 +356,8 @@overflow: hidden;position: relative;padding: 10px;+ display: flex;+ flex-direction: column;&-head {display: flex;diff --git a/src/app/[lng]/accounts/components/AccountSidebar/UserManageSidebar.tsx b/src/app/[lng]/accounts/components/AccountSidebar/UserManageSidebar.tsxindex dc208af9..264f1586 100644--- a/src/app/[lng]/accounts/components/AccountSidebar/UserManageSidebar.tsx+++ b/src/app/[lng]/accounts/components/AccountSidebar/UserManageSidebar.tsx@@ -17,6 +17,7 @@ import {updateAccountGroupApi,} from "@/api/account";import { AccountGroupItem } from "@/api/types/account.type";+import { useTransClient } from "@/app/i18n/client";export interface IUserManageSidebarRef {}@@ -37,6 +38,7 @@ const UserManageSidebar = memo({ activeGroup, allUser, onChange, onSortEnd }: IUserManageSidebarProps,ref: ForwardedRef<IUserManageSidebarRef>,) => {+ const { t } = useTransClient("account");const {accountGroupList,accountList,@@ -84,16 +86,16 @@ const UserManageSidebar = memo(setGroupName(rightClickOperateData!.name);}}>- 重命名+ {t("userManageSidebar.rename")}</MenuItem><MenuItemonClick={() => {confirm({- title: "提示",+ title: t("userManageSidebar.confirmDelete"),icon: <ExclamationCircleFilled />,content: (<>- 请确认是否删除列表:+ {t("userManageSidebar.confirmDeleteContent")}<spanstyle={{color: "var(--colorPrimary6)",@@ -107,22 +109,22 @@ const UserManageSidebar = memo(onOk: async () => {await deleteAccountGroupApi([rightClickOperateData!.id]);await getAccountGroup();- message.success("删除成功");+ message.success(t("userManageSidebar.deleteSuccess"));},});}}>- 删除+ {t("userManageSidebar.delete")}</MenuItem></ControlledMenu><Modalopen={openCreateGroup}- title={createGroupId === "-1" ? "新建空间" : "重命名空间"}+ title={createGroupId === "-1" ? t("userManageSidebar.createSpaceTitle") : t("userManageSidebar.renameSpaceTitle")}onCancel={createGroupCancel}footer={<>- <Button onClick={createGroupCancel}>取消</Button>+ <Button onClick={createGroupCancel}>{t("userManageSidebar.cancel")}</Button><Buttontype="primary"onClick={async () => {@@ -144,16 +146,16 @@ const UserManageSidebar = memo(}}loading={createGroupLoading}>- 保存+ {t("userManageSidebar.save")}</Button></>}><div className={styles.createGroup}>- <label>空间名</label>+ <label>{t("userManageSidebar.spaceName")}</label><Inputvalue={groupName}- placeholder="请输入空间名称"+ placeholder={t("userManageSidebar.spaceNamePlaceholder")}onChange={(e) => setGroupName(e.target.value)}/></div>@@ -170,13 +172,13 @@ const UserManageSidebar = memo(onChange(allUser);}}>- <span className="userManage-sidebar-name">全部账号</span>+ <span className="userManage-sidebar-name">{t("userManageSidebar.allAccounts")}</span><span className="userManage-sidebar-count">{accountList.length}</span></div><div className="userManage-sidebar-list">- <p className="userManage-sidebar-list-title">空间</p>+ <p className="userManage-sidebar-list-title">{t("userManageSidebar.spaces")}</p><ReactSortableclassName="userManage-sidebar-list-sortable"@@ -206,7 +208,7 @@ const UserManageSidebar = memo(onContextMenu={(e) => {e.preventDefault();if (v.isDefault) {- return message.error("不能操作默认列表");+ return message.error(t("userManageSidebar.cannotOperateDefault"));}setAnchorPoint({ x: e.clientX, y: e.clientY });setOpen(true);@@ -239,7 +241,7 @@ const UserManageSidebar = memo(setOpenCreateGroup(true);}}>- 新建空间+ {t("userManageSidebar.createSpace")}</Button></div></div>diff --git a/src/app/[lng]/accounts/components/AddAccountModal/index.tsx b/src/app/[lng]/accounts/components/AddAccountModal/index.tsxindex e8b67710..9b139a28 100644--- a/src/app/[lng]/accounts/components/AddAccountModal/index.tsx+++ b/src/app/[lng]/accounts/components/AddAccountModal/index.tsx@@ -92,27 +92,33 @@ const AddAccountModal = memo(};}, [open, targetGroupId, accountGroupList]);- // 判断平台是否在当前属地可用- const isPlatformAvailable = (platType: PlatType): boolean => {- // TODO: 暂时屏蔽国内平台 @@.@@- // return true;- if (isCnSpace === null) return true; // 未确定属地时显示所有平台-- const cnOnlyPlatforms = new Set<PlatType>([- PlatType.Douyin,- PlatType.KWAI,- PlatType.WxGzh,- PlatType.BILIBILI,- ]);-- if (isCnSpace === true) {- // 中国属地:仅国内平台可用- return cnOnlyPlatforms.has(platType);- } else {- // 非中国属地:国内平台不可用- return !cnOnlyPlatforms.has(platType);- }- };+ // 判断平台是否在当前属地可用+ const isPlatformAvailable = (platType: PlatType): boolean => {+ // TODO: 暂时屏蔽国内平台 @@.@@+ // return true;+ if (isCnSpace === null) return true; // 未确定属地时显示所有平台++ const cnOnlyPlatforms = new Set<PlatType>([+ PlatType.Douyin,+ PlatType.KWAI,+ PlatType.WxGzh,+ PlatType.WxSph,+ PlatType.BILIBILI,+ ]);++ // 小红书是全球平台,不受IP限制+ if (platType === PlatType.Xhs) {+ return true;+ }++ if (isCnSpace === true) {+ // 中国属地:仅国内平台可用+ return cnOnlyPlatforms.has(platType);+ } else {+ // 非中国属地:国内平台不可用+ return !cnOnlyPlatforms.has(platType);+ }+ };@@ -236,8 +242,8 @@ const AddAccountModal = memo(textAlign: 'center'}}>{isCnSpace ?- '当前空间为中国属地,仅显示国内平台' :- '当前空间为非中国属地,国内平台暂不可用'+ t('locationRestriction.cnSpace') :+ t('locationRestriction.nonCnSpace')}</div>)}diff --git a/src/app/config/platConfig.ts b/src/app/config/platConfig.tsindex dcc9d907..82edb744 100644--- a/src/app/config/platConfig.ts+++ b/src/app/config/platConfig.ts@@ -9,6 +9,7 @@ import facebookSvg from "@/assets/svgs/plat/facebook.svg";import instagramSvg from "@/assets/svgs/plat/instagram.svg";import threadsSvg from "@/assets/svgs/plat/xiancheng.svg";import wxGzhSvg from "@/assets/svgs/plat/wx-gzh.svg";+import wxSphSvg from "@/assets/svgs/plat/wx-sph.svg";import gongzhonghaoSvg from "@/assets/svgs/plat/gongzhonghao.png";import pinterestSvg from "@/assets/svgs/plat/pinterest.svg";import xhsSvg from "@/assets/svgs/plat/xhs.svg";@@ -86,22 +87,6 @@ export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([pcNoThis: true,},],- [- PlatType.Douyin,- {- name: "抖音",- icon: douyinSvg.src,- url: "https://www.douyin.com/",- pubTypes: new Set([]),- commonPubParamsConfig: {- titleMax: 30,- topicMax: 5,- desMax: 1000,- },- themeColor: "#FF4D00",- pcNoThis: true,- },- ],[PlatType.KWAI,{@@ -146,6 +131,39 @@ export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([themeColor: "green",},],++ [+ PlatType.Douyin,+ {+ name: "抖音",+ icon: douyinSvg.src,+ url: "https://www.douyin.com/",+ pubTypes: new Set([]),+ commonPubParamsConfig: {+ titleMax: 30,+ topicMax: 5,+ desMax: 1000,+ },+ themeColor: "#FF4D00",+ pcNoThis: true,+ },+ ],+ [+ PlatType.WxSph,+ {+ name: "微信视频号",+ icon: wxSphSvg.src,+ url: "https://mp.weixin.qq.com/",+ pubTypes: new Set([PubType.VIDEO, PubType.ImageText]),+ commonPubParamsConfig: {+ titleMax: 100,+ topicMax: 100,+ desMax: 5000,+ },+ themeColor: "green",+ pcNoThis: true,+ },+ ],[PlatType.Tiktok,{diff --git a/src/app/i18n/locales/en/account.json b/src/app/i18n/locales/en/account.jsonindex b39ff306..d5d85253 100644--- a/src/app/i18n/locales/en/account.json+++ b/src/app/i18n/locales/en/account.json@@ -64,5 +64,26 @@"success": "Channel created successfully","failed": "Failed to create channel","nameRequired": "Please enter channel name"+ },+ "locationRestriction": {+ "cnSpace": "Current space is in China region, only domestic platforms are shown",+ "nonCnSpace": "Current space is in non-China region, domestic platforms are temporarily unavailable"+ },+ "userManageSidebar": {+ "allAccounts": "All Accounts",+ "spaces": "Spaces",+ "createSpace": "Create Space",+ "spaceNamePlaceholder": "Enter space name",+ "cannotOperateDefault": "Cannot operate default list",+ "rename": "Rename",+ "delete": "Delete",+ "confirmDelete": "Confirm",+ "confirmDeleteContent": "Please confirm to delete the list:",+ "deleteSuccess": "Deleted successfully",+ "createSpaceTitle": "Create Space",+ "renameSpaceTitle": "Rename Space",+ "cancel": "Cancel",+ "save": "Save",+ "spaceName": "Space Name"}}\ No newline at end of filediff --git a/src/app/i18n/locales/en/common.json b/src/app/i18n/locales/en/common.jsonindex 437ebbbf..d741b97d 100644--- a/src/app/i18n/locales/en/common.json+++ b/src/app/i18n/locales/en/common.json@@ -47,6 +47,17 @@"consecutiveDays": "Consecutive Days","totalPoints": "Total Points"},+ "downloadApp": {+ "title": "Download {{appName}}",+ "operationInApp": "Please operate in {{appName}} to add",+ "description": "For better user experience and complete functionality, this operation needs to be completed in {{appName}} to add accounts. Please download and install {{appName}} to continue.",+ "scanQrCode": "Scan QR code to download",+ "downloadLink": "Download link:",+ "copy": "Copy",+ "close": "Close",+ "downloadNow": "Download Now",+ "tip": "💡 Tip: After installation, please log in to your account in the App, then try the related operation again"+ },"websit": {"termsOfService": {"title": "Terms of Service",diff --git a/src/app/i18n/locales/zh-CN/account.json b/src/app/i18n/locales/zh-CN/account.jsonindex 6409cd2b..207e5707 100644--- a/src/app/i18n/locales/zh-CN/account.json+++ b/src/app/i18n/locales/zh-CN/account.json@@ -64,5 +64,26 @@"success": "新建空间成功","failed": "新建空间失败","nameRequired": "请输入空间名称"+ },+ "locationRestriction": {+ "cnSpace": "当前空间为中国属地,仅显示国内平台",+ "nonCnSpace": "当前空间为非中国属地,国内平台暂不可用"+ },+ "userManageSidebar": {+ "allAccounts": "全部账号",+ "spaces": "空间",+ "createSpace": "新建空间",+ "spaceNamePlaceholder": "请输入空间名称",+ "cannotOperateDefault": "不能操作默认列表",+ "rename": "重命名",+ "delete": "删除",+ "confirmDelete": "提示",+ "confirmDeleteContent": "请确认是否删除列表:",+ "deleteSuccess": "删除成功",+ "createSpaceTitle": "新建空间",+ "renameSpaceTitle": "重命名空间",+ "cancel": "取消",+ "save": "保存",+ "spaceName": "空间名"}}\ No newline at end of filediff --git a/src/app/i18n/locales/zh-CN/common.json b/src/app/i18n/locales/zh-CN/common.jsonindex 4da28105..ab74bc4d 100644--- a/src/app/i18n/locales/zh-CN/common.json+++ b/src/app/i18n/locales/zh-CN/common.json@@ -47,6 +47,17 @@"consecutiveDays": "连续签到天数","totalPoints": "总积分"},+ "downloadApp": {+ "title": "下载{{appName}}",+ "operationInApp": "请在{{appName}}中操作添加",+ "description": "为了更好的用户体验和功能完整性,该操作需要在 {{appName}} 中完成账号添加。请下载并安装 {{appName}} 后继续操作。",+ "scanQrCode": "扫描二维码下载",+ "downloadLink": "下载链接:",+ "copy": "复制",+ "close": "关闭",+ "downloadNow": "立即下载",+ "tip": "💡 提示:安装完成后,请在App中登录您的账号,然后重新尝试相关操作"+ },"websit": {"termsOfService": {"title": "用户协议",diff --git a/src/components/common/DownloadAppModal.tsx b/src/components/common/DownloadAppModal.tsxindex 1da4d79d..5af72fb6 100644--- a/src/components/common/DownloadAppModal.tsx+++ b/src/components/common/DownloadAppModal.tsx@@ -1,8 +1,9 @@-import React from 'react';-import { Modal, Button, Space, Typography } from 'antd';-import { DownloadOutlined, QrcodeOutlined } from '@ant-design/icons';+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 logo from '@/assets/images/logo.png';+import { QRCode } from 'react-qrcode-logo';const { Text, Paragraph } = Typography;@@ -25,21 +26,25 @@ const DownloadAppModal: React.FC<DownloadAppModalProps> = ({platform = "",appName = "Aitoearn App",downloadUrl,- qrCodeUrl+ qrCodeUrl = ''}) => {const { t } = useTransClient("common");+ const [copySuccess, setCopySuccess] = useState(false);const handleDownload = () => {- if (downloadUrl) {- window.open(downloadUrl, '_blank');- }+ const linkToOpen = downloadUrl || "https://yikart.oss-cn-beijing.aliyuncs.com/aitoearn-1.0.9.1.apk";+ window.open(linkToOpen, '_blank');};- const handleCopyLink = () => {- if (downloadUrl) {- navigator.clipboard.writeText(downloadUrl).then(() => {- // 可以添加复制成功的提示- });+ const handleCopyLink = async () => {+ const linkToCopy = downloadUrl || "https://yikart.oss-cn-beijing.aliyuncs.com/aitoearn-1.0.9.1.apk";+ try {+ await navigator.clipboard.writeText(linkToCopy);+ setCopySuccess(true);+ message.success(t('downloadApp.copy') + '成功');+ setTimeout(() => setCopySuccess(false), 2000);+ } catch (error) {+ message.error('复制失败,请手动复制');}};@@ -48,104 +53,123 @@ const DownloadAppModal: React.FC<DownloadAppModalProps> = ({title={<Space><img src={logo.src} alt="Aitoearn" style={{ width: 20, height: 20, borderRadius: 4 }} />- <span>下载{appName}</span>+ <span>{t('downloadApp.title', { appName })}</span></Space>}open={visible}onCancel={onClose}footer={[<Button key="close" onClick={onClose}>- 关闭+ {t('downloadApp.close')}</Button>,- downloadUrl && (- <Button- key="download"- type="primary"- icon={<DownloadOutlined />}- onClick={handleDownload}- >- 立即下载- </Button>- )+ <Button+ key="download"+ type="primary"+ icon={<DownloadOutlined />}+ onClick={handleDownload}+ >+ {t('downloadApp.downloadNow')}+ </Button>]}- width={500}+ width={520}centereddestroyOnClose><div style={{ textAlign: 'center', padding: '20px 0' }}>+ {/* App Logo */}<div style={{ marginBottom: '24px' }}>- <img src={logo.src} alt="Aitoearn" style={{ width: 56, height: 56, borderRadius: 12 }} />+ <img src={logo.src} alt="Aitoearn" style={{ width: 64, height: 64, borderRadius: 16, boxShadow: '0 4px 12px rgba(0,0,0,0.1)' }} /></div>- <Typography.Title level={4} style={{ marginBottom: '16px' }}>- 请在{appName}中操作添加+ {/* 标题 */}+ <Typography.Title level={4} style={{ marginBottom: '16px', color: '#1f2937' }}>+ {t('downloadApp.operationInApp', { appName })}</Typography.Title>- <Paragraph style={{ color: '#666', marginBottom: '24px' }}>- 为了更好的用户体验和功能完整性,该操作需要在 {appName} 中完成账号添加。- 请下载并安装 {appName} 后继续操作。+ {/* 描述 */}+ <Paragraph style={{ color: '#6b7280', marginBottom: '32px', fontSize: '14px', lineHeight: '1.6' }}>+ {t('downloadApp.description', { appName })}</Paragraph>- {qrCodeUrl && (- <div style={{ marginBottom: '24px' }}>- <div style={{ marginBottom: '8px' }}>- <QrcodeOutlined style={{ marginRight: '4px' }} />- <Text strong>扫描二维码下载</Text>- </div>- <img- src={qrCodeUrl}- alt="下载二维码"- style={{- width: '120px',- height: '120px',- border: '1px solid #e8e8e8',- borderRadius: '8px'- }}+ {/* 二维码区域 */}+ <div style={{+ marginBottom: '32px',+ padding: '20px',+ backgroundColor: '#f9fafb',+ borderRadius: '12px',+ border: '1px solid #e5e7eb'+ }}>+ <div style={{ marginBottom: '12px', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '8px' }}>+ <QrcodeOutlined style={{ color: '#6b7280' }} />+ <Text strong style={{ color: '#374151' }}>{t('downloadApp.scanQrCode')}</Text>+ </div>+ <div style={{ display: 'flex', justifyContent: 'center' }}>+ <QRCode+ value={downloadUrl || "https://yikart.oss-cn-beijing.aliyuncs.com/aitoearn-1.0.9.1.apk"}+ size={140}/></div>- )}+ </div>- {downloadUrl && (- <div style={{ marginBottom: '16px' }}>- <Space direction="vertical" size="small">- <Text type="secondary">下载链接:</Text>- <div style={{- display: 'flex',- alignItems: 'center',- gap: '8px',- justifyContent: 'center'- }}>- <Text- code- style={{- maxWidth: '300px',- overflow: 'hidden',- textOverflow: 'ellipsis',- whiteSpace: 'nowrap'- }}- >- {downloadUrl}- </Text>- <Button- size="small"- onClick={handleCopyLink}- type="text"- >- 复制- </Button>- </div>- </Space>- </div>- )}+ {/* 下载链接区域 */}+ <div style={{+ marginBottom: '24px',+ padding: '16px',+ backgroundColor: '#f8fafc',+ borderRadius: '8px',+ border: '1px solid #e2e8f0'+ }}>+ <Space direction="vertical" size="small" style={{ width: '100%' }}>+ <Text type="secondary" style={{ fontSize: '13px' }}>{t('downloadApp.downloadLink')}</Text>+ <div style={{+ display: 'flex',+ alignItems: 'center',+ gap: '8px',+ justifyContent: 'center',+ backgroundColor: '#ffffff',+ padding: '8px 12px',+ borderRadius: '6px',+ border: '1px solid #e2e8f0'+ }}>+ <Text+ code+ style={{+ maxWidth: '280px',+ overflow: 'hidden',+ textOverflow: 'ellipsis',+ whiteSpace: 'nowrap',+ fontSize: '12px',+ color: '#475569'+ }}+ >+ {downloadUrl || "https://yikart.oss-cn-beijing.aliyuncs.com/aitoearn-1.0.9.1.apk"}+ </Text>+ <Button+ size="small"+ onClick={handleCopyLink}+ type="text"+ icon={copySuccess ? <CheckOutlined style={{ color: '#10b981' }} /> : <CopyOutlined />}+ style={{+ minWidth: 'auto',+ padding: '4px 8px',+ color: copySuccess ? '#10b981' : '#6b7280'+ }}+ >+ {copySuccess ? '已复制' : t('downloadApp.copy')}+ </Button>+ </div>+ </Space>+ </div>+ {/* 提示信息 */}<div style={{padding: '16px',- backgroundColor: '#f6f8fa',+ backgroundColor: '#eff6ff',borderRadius: '8px',- border: '1px solid #e1e4e8'+ border: '1px solid #dbeafe'}}>- <Text type="secondary">- 💡 提示:安装完成后,请在App中登录您的账号,然后重新尝试相关操作+ <Text type="secondary" style={{ fontSize: '13px', color: '#1e40af' }}>+ {t('downloadApp.tip')}</Text></div></div>