返回 AiToEarn
comment.ts
1 /*
2 * @Author: nevin
3 * @Date: 2025-01-21 15:58:41
4 * @LastEditTime: 2025-02-12 17:38:55
5 * @LastEditors: nevin
6 * @Description: 账户
7 */
8
9 import { PlatType } from '../../../commont/AccountEnum';
10 import { PubType } from '../../../commont/publish/PublishEnum';
11 import ksSvg from '../../assets/svgs/account/ks.svg';
12 import xhsSvg from '../../assets/svgs/account/xhs.svg';
13 import douyinSvg from '../../assets/svgs/account/douyin.svg';
14 import wxSphSvg from '../../assets/svgs/account/wx-sph.svg';
15 import { AccountModel } from '../../../electron/db/models/account';
16
17 export interface IAccountPlatInfo {
18 // 显示的icon
19 icon: string;
20 // 平台中文名称
21 name: string;
22 // 平台url
23 url: string;
24 // 支持的发布类型
25 pubTypes: Set<PubType>;
26 /**
27 * 通用发布参数配置,有两个地方用到
28 * 1. 在设置通用发布参数的时候会根据当前选择的账户中的最小参数为基准设置参数限制
29 * 2. 规定每个平台通用参数的限制
30 */
31 commonPubParamsConfig: {
32 // title限制字数,可以不填,不填表示该平台无标题参数
33 titleMax?: number;
34 // 定时发布,可以不填,不填表示该平台无定时发布参数
35 timingMax?: {
36 // 同 VideoPubSetModalCommon.maxDate
37 maxDate: number;
38 // 同 VideoPubSetModalCommon.timeOffset
39 timeOffset: number;
40 };
41 // 话题数量限制
42 topicMax: number;
43 // 仅图文发布的限制参数
44 imgTextConfig?: {
45 imagesMax: number;
46 };
47 };
48 // 平台提示
49 tips?: {
50 // 添加账号时候的提示
51 account: string;
52 // 在发布时添加账号时候的提示
53 publish: string;
54 };
55 }
56
57 // 支持所有发布
58 const PubTypeAll = new Set([PubType.ARTICLE, PubType.VIDEO, PubType.ImageText]);
59 // 各个平台的信息
60 export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([
61 [
62 PlatType.KWAI,
63 {
64 name: '快手',
65 icon: ksSvg,
66 url: 'https://cp.kuaishou.com/profile',
67 pubTypes: new Set([PubType.VIDEO]),
68 commonPubParamsConfig: {
69 timingMax: {
70 maxDate: 13,
71 timeOffset: 60,
72 },
73 topicMax: 4,
74 },
75 },
76 ],
77 [
78 PlatType.Xhs,
79 {
80 name: '小红书',
81 icon: xhsSvg,
82 url: 'https://creator.xiaohongshu.com/login?source=official',
83 // url: 'https://www.xiaohongshu.com/explore',
84 pubTypes: PubTypeAll,
85 commonPubParamsConfig: {
86 timingMax: {
87 maxDate: 14,
88 timeOffset: 60,
89 },
90 topicMax: 20,
91 titleMax: 20,
92 imgTextConfig: {
93 imagesMax: 18,
94 },
95 },
96 },
97 ],
98 [
99 PlatType.Douyin,
100 {
101 name: '抖音',
102 icon: douyinSvg,
103 url: 'https://creator.douyin.com/creator-micro/content/upload?enter_from=dou_web',
104 pubTypes: PubTypeAll,
105 commonPubParamsConfig: {
106 timingMax: {
107 maxDate: 14,
108 timeOffset: 120,
109 },
110 titleMax: 30,
111 topicMax: 5,
112 imgTextConfig: {
113 imagesMax: 35,
114 },
115 },
116 // tips: {
117 // account: '首次登录的抖音号可能会频繁掉线,通常将在重登2-3次后趋于稳定',
118 // publish:
119 // '首次登录的抖音账号请先在账户单独完成一次内容发布后再做一键发布',
120 // },
121 },
122 ],
123 [
124 PlatType.WxSph,
125 {
126 name: '微信视频号',
127 icon: wxSphSvg,
128 url: 'https://channels.weixin.qq.com/cgi-bin/mmfinderassistant-bin/helper/hepler_merlin_mmdata?_rid=67b30b55-6e3ea588',
129 pubTypes: new Set([PubType.VIDEO]),
130 commonPubParamsConfig: {
131 timingMax: {
132 maxDate: 30,
133 timeOffset: 60,
134 },
135 titleMax: 16,
136 topicMax: 10,
137 },
138 },
139 ],
140 ]);
141
142 export type AccountInfo = AccountModel;
143
143 lines TYPESCRIPT