fix: fetch list axios token incorrect

This commit is contained in:
jialin
2026-01-15 17:48:45 +08:00
parent fe79258766
commit 337cb67cd9
3 changed files with 9 additions and 18 deletions
+2 -2
View File
@@ -137,7 +137,7 @@ export default function useTableFetch<T>(
axiosTokenRef.current?.cancel?.();
axiosTokenRef.current = createAxiosToken();
const res = await fetchAPI(params, {
token: axiosTokenRef.current
token: axiosTokenRef.current.token
});
shouldUpdateRef.current = false;
loadendRef.current = true;
@@ -160,7 +160,7 @@ export default function useTableFetch<T>(
query: { ...newParams }
};
const newRes = await fetchAPI(newParams, {
token: axiosTokenRef.current
token: axiosTokenRef.current.token
});
setDataSource({
+7 -5
View File
@@ -113,11 +113,13 @@ const Catalog: React.FC = () => {
const getCatalogSource = async () => {
try {
const id = dataSource.dataList?.[0]?.id;
const res: any = await queryCatalogItemSpec({
id,
cluster_id: null
});
sourceRef.current = res?.items?.[0]?.source;
if (id) {
const res: any = await queryCatalogItemSpec({
id,
cluster_id: null
});
sourceRef.current = res?.items?.[0]?.source;
}
} catch (error) {}
};
getCatalogSource();