mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-20 10:45:52 +00:00
fix: 账单第一页不展示
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { useState, useCallback } from 'react';
|
import { useState, useCallback, useEffect } from 'react';
|
||||||
import type { PagingData } from '../types/index';
|
import type { PagingData } from '../types/index';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { useToast } from './useToast';
|
import { useToast } from './useToast';
|
||||||
|
|
||||||
export const usePaging = <T = any>({
|
export const usePaging = <T = any>({
|
||||||
@@ -64,7 +63,9 @@ export const usePaging = <T = any>({
|
|||||||
getData(pageNum + 1);
|
getData(pageNum + 1);
|
||||||
}, [getData, isLoadAll, pageNum, requesting]);
|
}, [getData, isLoadAll, pageNum, requesting]);
|
||||||
|
|
||||||
useQuery(['init'], () => getData(1, true));
|
useEffect(() => {
|
||||||
|
getData(1, true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
pageNum,
|
pageNum,
|
||||||
|
@@ -10,21 +10,12 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Input,
|
Input,
|
||||||
Box,
|
Box,
|
||||||
Grid,
|
Grid
|
||||||
Table,
|
|
||||||
Thead,
|
|
||||||
Tbody,
|
|
||||||
Tr,
|
|
||||||
Th,
|
|
||||||
Td,
|
|
||||||
TableContainer
|
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { getPayCode, checkPayResult } from '@/api/user';
|
import { getPayCode, checkPayResult } from '@/api/user';
|
||||||
import { useToast } from '@/hooks/useToast';
|
import { useToast } from '@/hooks/useToast';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { modelList } from '@/constants/model';
|
|
||||||
import { formatPrice } from '../../../utils/user';
|
|
||||||
|
|
||||||
const PayModal = ({ onClose }: { onClose: () => void }) => {
|
const PayModal = ({ onClose }: { onClose: () => void }) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
Reference in New Issue
Block a user