Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
抖音搜索结果不出现问题
DESKTOP-EMF2SH4\Administratore0589e737a05
diff --git a/electron/plat/douyin/index.ts b/electron/plat/douyin/index.tsindex 9e14c351..f2141bf3 100644--- a/electron/plat/douyin/index.ts+++ b/electron/plat/douyin/index.ts@@ -2117,9 +2117,10 @@ export class DouyinService {) {const pcursor =pageInfo.pcursor && Number(pageInfo.pcursor) < 16 ? 0 : pageInfo.pcursor;- const count = Number(pcursor) > 10 ? 10 : 16;+ const count = Number(pcursor) > 10 ? 10 : 20;const gets: any = {+ device_platform: 'webapp',aid: '6383',keyword: qe,offset: pcursor,@@ -2131,13 +2132,14 @@ export class DouyinService {const thisUri = `https://www.douyin.com/aweme/v1/web/search/item/?${jsonToQueryString(gets,)}`;- console.log('thisUrithisUrithisUri',thisUri)+ console.log('thisUrithisUrithisUri',thisUri)// 方法const res = await requestNet<any>({url: thisUri,headers: {cookie: CookieToString(cookie),- // referer: 'https://www.douyin.com/'+ 'User-Agent': this.defaultUserAgent,+ referer: encodeURI('https://www.douyin.com/root/search/'+ qe +'?type=video')},method: 'GET',});diff --git a/src/views/replyother/replyother.tsx b/src/views/replyother/replyother.tsxindex 9cab9d05..70882a0b 100644--- a/src/views/replyother/replyother.tsx+++ b/src/views/replyother/replyother.tsx@@ -255,7 +255,7 @@ export default function Page() {setIsLoadingMore(true);try {setTimeout(async () => {- await getSearchListFunc(activeAccountId, searchKeyword, true);+ await getSearchListFunc(activeAccountId, searchKeyword, false);}, 0);} finally {setIsLoadingMore(false);@@ -512,14 +512,18 @@ export default function Page() {console.log('没有更多数据了,不再发送请求');return;}-+ console.log('activeAccountType', activeAccountType)+ if (isfirst) {+ setPostFirstId('');+ pageInfo.pcursor = 1;+ }const res = await getCommentSearchNotes(thisid, qe, {...pageInfo,postFirstId: postFirstId,});console.log('------ getSearchListFunc -- @@:', res);if (isfirst && activeAccountType == 'douyin') {- setPostFirstId(res.orgList?.log_pb?.impr_id);+ setPostFirstId(res.orgList?.log_pb?.impr_id || '');} else if (isfirst && activeAccountType == 'KWAI') {console.log('------ getSearchListFunc -- @@:',@@ -539,6 +543,7 @@ export default function Page() {hasMore: res.pageInfo.hasMore || false,pcursor: res.pageInfo.pcursor || '',});+} else {// 如果没有返回数据,设置hasMore为falsesetPageInfo((prev) => ({