fix: use auth_index field from API response for auth file mapping
- API returns 'auth_index' not 'authIndex' - Support both field names for compatibility - Properly map hash-based auth_index to file name
This commit is contained in:
@@ -135,8 +135,13 @@ export function RequestLogs({ data, loading: parentLoading, providerMap, provide
|
|||||||
const files = response?.files || [];
|
const files = response?.files || [];
|
||||||
const map: Record<string, string> = {};
|
const map: Record<string, string> = {};
|
||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
if (file.authIndex !== undefined && file.authIndex !== null) {
|
// 兼容 auth_index 和 authIndex 两种字段名(API 返回的是 auth_index)
|
||||||
map[String(file.authIndex)] = file.name;
|
const rawAuthIndex = (file as Record<string, unknown>)['auth_index'] ?? file.authIndex;
|
||||||
|
if (rawAuthIndex !== undefined && rawAuthIndex !== null) {
|
||||||
|
const authIndexKey = String(rawAuthIndex).trim();
|
||||||
|
if (authIndexKey) {
|
||||||
|
map[authIndexKey] = file.name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setAuthIndexMap(map);
|
setAuthIndexMap(map);
|
||||||
|
|||||||
Reference in New Issue
Block a user