Skip to content

Commit d340736

Browse files
committed
fix: modify the variable next_page to next_cursor since it has been changed
1 parent 4b264da commit d340736

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

app/scripts/reactVirtual/API.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const fetchToGetMyFriends = async (props: IGetFriendsProps) => {
130130
data = await response.json()
131131
// 防止过快导致接口请求被封
132132
await sleep(0.3)
133-
data = { ...(data || {}), uid, hasMore: data?.next_page > 0 }
133+
data = { ...(data || {}), uid, hasMore: data?.next_cursor > 0 }
134134
status = true
135135
} catch (e) {
136136
console.log(`fetchToGetFriends`, e)
@@ -154,7 +154,7 @@ export const fetchToGetOthersFriends = async (props: IGetFriendsProps) => {
154154
data = await response.json()
155155
// 防止过快导致接口请求被封
156156
await sleep(0.3)
157-
data = { ...(data || {}), uid, hasMore: data?.next_page > 0 }
157+
data = { ...(data || {}), uid, hasMore: data?.next_cursor > 0 }
158158
status = true
159159
} catch (e) {
160160
console.log(`fetchToGetOthersFriends`, e)

app/scripts/reactVirtual/slice.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export const removeFans = createAsyncThunk(
162162
const pageIndex = params?.pageIndex || 1
163163
console.log(`pageIndex`, pageIndex)
164164
const friendsResp = await fetchToGetMyFriends({ uid: params.uid, pageIndex })
165-
const { next_page, users } = friendsResp?.data || {}
165+
const { next_cursor, users } = friendsResp?.data || {}
166166
const friends = users?.length ? users : []
167167
console.log(`friends`, friends)
168168
if (_.isEmpty(friends)) {
@@ -182,7 +182,7 @@ export const removeFans = createAsyncThunk(
182182
}
183183
}
184184

185-
if (!(next_page > 0)) {
185+
if (!(next_cursor > 0)) {
186186
dispatch(updateState({ fansPageremovingFans: '__completed__' }))
187187
return friends
188188
}
@@ -204,7 +204,7 @@ export const blockOthersFans = createAsyncThunk(
204204
if (!params?.otherUid) return
205205

206206
const friendsResp = await fetchToGetOthersFriends({ uid: params.otherUid, pageIndex })
207-
const { next_page, users } = friendsResp?.data || {}
207+
const { next_cursor, users } = friendsResp?.data || {}
208208
const friends = users?.length ? users : []
209209
if (_.isEmpty(friends)) {
210210
return true
@@ -219,7 +219,7 @@ export const blockOthersFans = createAsyncThunk(
219219
await sleep(2 + Math.random() * 2)
220220
dispatch(updateState({ fansPageBlockingUser: friend?.screen_name || friend?.name || '' }))
221221
}
222-
if (!(next_page > 0)) return true
222+
if (!(next_cursor > 0)) return true
223223
await sleep(5 + Math.random() * 5)
224224
dispatch(blockOthersFans({ otherUid, pageIndex: pageIndex + 1 }))
225225
return null
@@ -239,7 +239,7 @@ export const unBlockOthersFans = createAsyncThunk(
239239
if (!params?.otherUid) return
240240

241241
const friendsResp = await fetchToGetOthersFriends({ uid: params.otherUid, pageIndex })
242-
const { next_page, users } = friendsResp?.data || {}
242+
const { next_cursor, users } = friendsResp?.data || {}
243243
const friends = users?.length ? users : []
244244
if (_.isEmpty(friends)) {
245245
return true
@@ -253,7 +253,7 @@ export const unBlockOthersFans = createAsyncThunk(
253253
dispatch(updateState({ fansPageUnBlockingUser: friend?.screen_name || friend?.name || '' }))
254254
}
255255

256-
if (!(next_page > 0)) return true
256+
if (!(next_cursor > 0)) return true
257257
dispatch(unBlockOthersFans({ otherUid, pageIndex: pageIndex + 1 }))
258258
return null
259259
}

extension/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "微博扩展",
44
"description": "微博扩展插件 - 支持一键拉黑点赞",
5-
"version": "1.8",
5+
"version": "1.9",
66
"permissions": ["scripting"],
77
"host_permissions": ["https://weibo.com/*", "https://*.weibo.com/*"],
88
"icons": {

0 commit comments

Comments
 (0)