🐞 fix(邀请码): 修复分页引发的问题
This commit is contained in:
parent
b8a7d5634f
commit
ea1de11eb5
@ -5,6 +5,7 @@ import useUserInfo from './useUserInfo'
|
||||
import useLogin from './useLogin'
|
||||
import useLoginRequest from './useLoginRequest'
|
||||
import { BASE_URL, WX_APPID } from '@/common/constant'
|
||||
import { getFilterData } from '@/common/util'
|
||||
|
||||
interface Params {
|
||||
code: string | null
|
||||
@ -133,12 +134,13 @@ export const useRequest = (
|
||||
stateRef.current.query = {
|
||||
...sub_options,
|
||||
...(options.pagination && {
|
||||
page: stateRef.current.page,
|
||||
size: stateRef.current.pageSize,
|
||||
page: stateRef.current.page || '',
|
||||
size: stateRef.current.pageSize || '',
|
||||
}),
|
||||
...stateRef.current.filter,
|
||||
...stateRef.current.sort,
|
||||
}
|
||||
const query = getFilterData(stateRef.current.query)
|
||||
try {
|
||||
const token = Taro.getStorageSync('token')
|
||||
const q = {
|
||||
@ -152,10 +154,10 @@ export const useRequest = (
|
||||
},
|
||||
...(options.method?.toUpperCase() == 'GET'
|
||||
? {
|
||||
data: stateRef.current.query,
|
||||
data: query,
|
||||
}
|
||||
: {
|
||||
data: options.type?.toUpperCase() == 'FORMDATA' ? qs.stringify(stateRef.current?.query) : stateRef.current.query,
|
||||
data: options.type?.toUpperCase() == 'FORMDATA' ? qs.stringify(stateRef.current?.query) : query,
|
||||
}),
|
||||
}
|
||||
const result = await Taro.request(q as any)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user