File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,7 @@ interface PostData {
1919}
2020
2121interface PostListResponse {
22- code : 200 ;
23- currentTemplate : "DiscussList" ;
24- currentData : {
22+ data : {
2523 forum : ForumData | null ;
2624 publicForums : ForumData [ ] ;
2725 posts : {
@@ -45,7 +43,7 @@ export default async function getPostList(
4543 false ,
4644 ) ;
4745 const {
48- currentData : {
46+ data : {
4947 posts : { result } ,
5048 } ,
5149 } = ( await response . json ( ) ) as PostListResponse ;
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export async function getResponse(
3030 const response = await fetch ( url , {
3131 headers : {
3232 "x-luogu-type" : "content-only" ,
33+ "x-lentille-request" : "content-only" ,
3334 ...( cookie ? { cookie : process . env . COOKIE ! } : { } ) ,
3435 } ,
3536 cache : "no-cache" ,
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ interface ReplyData {
3939}
4040
4141interface ResponseBody {
42- currentData : {
42+ data : {
4343 forum : ForumData ;
4444 post : PostData ;
4545 replies : ReplyData ;
@@ -125,7 +125,7 @@ export async function savePost(
125125 } ) ;
126126 } ;
127127
128- const { post, replies, forum } = ( await fetchPage ( 1 ) ) . currentData ;
128+ const { post, replies, forum } = ( await fetchPage ( 1 ) ) . data ;
129129 const postTime = new Date ( post . time * 1000 ) ;
130130
131131 await upsertUserSnapshot ( prisma , post . author ) ;
@@ -184,7 +184,7 @@ export async function savePost(
184184 ) [ 0 ] ;
185185 for ( let i = Math . min ( pages , maxPages ) ; i > 0 ; i -= 1 ) {
186186 // eslint-disable-next-line no-await-in-loop
187- const { replies : newReplies } = ( await fetchPage ( i ) ) . currentData ;
187+ const { replies : newReplies } = ( await fetchPage ( i ) ) . data ;
188188 // eslint-disable-next-line no-await-in-loop
189189 await saveReplies ( newReplies . result ) ;
190190 if ( newReplies . result [ newReplies . result . length - 1 ] . id <= lastReply )
You can’t perform that action at this time.
0 commit comments