Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
fix: 小红书作品cookie修复、视频发布进度100%写个全局
gaoSirfeb14eb6fb46
diff --git a/electron/main/plat/platforms/xhs/index.ts b/electron/main/plat/platforms/xhs/index.tsindex a0e16cc6..2f19206d 100644--- a/electron/main/plat/platforms/xhs/index.ts+++ b/electron/main/plat/platforms/xhs/index.ts@@ -30,6 +30,7 @@ import {import { AccountType } from '../../../../../commont/AccountEnum';import { AccountModel } from '../../../../db/models/account';import { VisibleTypeEnum } from '../../../../../commont/publish/PublishEnum';+import { CookieToString } from '../../../../plat/utils';export class Xhs extends PlatformBase {constructor() {@@ -137,7 +138,7 @@ export class Xhs extends PlatformBase {/*** 获取作品列表* @param account- * @param pageInfo+ * @param pcursor* @returns*/async getWorkList(account: AccountModel, pcursor?: string) {@@ -146,7 +147,10 @@ export class Xhs extends PlatformBase {// TODO: 小红书的分页每页数量?const pageSize = 20;const cookie: CookiesType = JSON.parse(account.loginCookie);- const res = await xiaohongshuService.getWorks(cookie, pageNo);+ const res = await xiaohongshuService.getWorks(+ CookieToString(cookie),+ pageNo,+ );const list: WorkData[] = res.data.data.notes.map((v) => ({dataId: v.id,diff --git a/electron/main/plat/pub/PubItemVideo.ts b/electron/main/plat/pub/PubItemVideo.tsindex 0e91a714..9f8258da 100644--- a/electron/main/plat/pub/PubItemVideo.ts+++ b/electron/main/plat/pub/PubItemVideo.ts@@ -65,6 +65,11 @@ export class PubItemVideo extends PubItemBase {this.videoModel.status = PubStatus.RELEASED;this.videoModel.dataId = publishVideoResult.dataId;this.videoModel.previewVideoLink = publishVideoResult.previewVideoLink;+ windowOperate.sendRenderMsg(SendChannelEnum.VideoPublishProgress, {+ progress: 100,+ msg: '发布成功!',+ account: this.accountModel,+ });}await this.uploadRecord();return publishVideoResult;diff --git a/electron/plat/douyin/index.ts b/electron/plat/douyin/index.tsindex 83aa99b8..4e103aa6 100644--- a/electron/plat/douyin/index.ts+++ b/electron/plat/douyin/index.ts@@ -517,6 +517,7 @@ export class DouyinService {return new Promise(async (resolve, reject) => {try {+ this.callback = callback;// 初始化cookieconsole.log('开始转换cookie...');callback(5, '正在加载');diff --git a/electron/plat/xiaohongshu/index.ts b/electron/plat/xiaohongshu/index.tsindex e89b2359..ec0485f7 100644--- a/electron/plat/xiaohongshu/index.ts+++ b/electron/plat/xiaohongshu/index.ts@@ -720,7 +720,7 @@ export class XiaohongshuService {if (this.callback)this.callback(50,- `上传视频(${filePartInfo.blockInfo}/${filePartInfo.blockInfo.length})`,+ `上传视频(${i}/${filePartInfo.blockInfo.length})`,);const chunkStart =