fix: fetch list axios token incorrect
This commit is contained in:
@@ -74,17 +74,6 @@ export default [
|
|||||||
defaultIcon: 'icon-audio1',
|
defaultIcon: 'icon-audio1',
|
||||||
component: './playground/speech'
|
component: './playground/speech'
|
||||||
}
|
}
|
||||||
// {
|
|
||||||
// name: 'video',
|
|
||||||
// title: 'Video',
|
|
||||||
// path: '/playground/video',
|
|
||||||
// key: 'video',
|
|
||||||
// icon: 'icon-video-outline',
|
|
||||||
// hideInMenu: false,
|
|
||||||
// selectedIcon: 'icon-video-filled02',
|
|
||||||
// defaultIcon: 'icon-video-outline',
|
|
||||||
// component: './playground/video'
|
|
||||||
// }
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export default function useTableFetch<T>(
|
|||||||
axiosTokenRef.current?.cancel?.();
|
axiosTokenRef.current?.cancel?.();
|
||||||
axiosTokenRef.current = createAxiosToken();
|
axiosTokenRef.current = createAxiosToken();
|
||||||
const res = await fetchAPI(params, {
|
const res = await fetchAPI(params, {
|
||||||
token: axiosTokenRef.current
|
token: axiosTokenRef.current.token
|
||||||
});
|
});
|
||||||
shouldUpdateRef.current = false;
|
shouldUpdateRef.current = false;
|
||||||
loadendRef.current = true;
|
loadendRef.current = true;
|
||||||
@@ -160,7 +160,7 @@ export default function useTableFetch<T>(
|
|||||||
query: { ...newParams }
|
query: { ...newParams }
|
||||||
};
|
};
|
||||||
const newRes = await fetchAPI(newParams, {
|
const newRes = await fetchAPI(newParams, {
|
||||||
token: axiosTokenRef.current
|
token: axiosTokenRef.current.token
|
||||||
});
|
});
|
||||||
|
|
||||||
setDataSource({
|
setDataSource({
|
||||||
|
|||||||
@@ -113,11 +113,13 @@ const Catalog: React.FC = () => {
|
|||||||
const getCatalogSource = async () => {
|
const getCatalogSource = async () => {
|
||||||
try {
|
try {
|
||||||
const id = dataSource.dataList?.[0]?.id;
|
const id = dataSource.dataList?.[0]?.id;
|
||||||
const res: any = await queryCatalogItemSpec({
|
if (id) {
|
||||||
id,
|
const res: any = await queryCatalogItemSpec({
|
||||||
cluster_id: null
|
id,
|
||||||
});
|
cluster_id: null
|
||||||
sourceRef.current = res?.items?.[0]?.source;
|
});
|
||||||
|
sourceRef.current = res?.items?.[0]?.source;
|
||||||
|
}
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
};
|
};
|
||||||
getCatalogSource();
|
getCatalogSource();
|
||||||
|
|||||||
Reference in New Issue
Block a user