Commit 29131ca9 by 黄南光

修改前端运行错误

1 parent 341502d2
...@@ -218,7 +218,10 @@ export default function EnterpriseWiki() { ...@@ -218,7 +218,10 @@ export default function EnterpriseWiki() {
if (Array.isArray(responseFormats)) { if (Array.isArray(responseFormats)) {
setFormatOptions(responseFormats.filter((format): format is string => typeof format === "string" && format.length > 0)); setFormatOptions(responseFormats.filter((format): format is string => typeof format === "string" && format.length > 0));
} else { } else {
setFormatOptions(Array.from(new Set((data.files || []).map((file: FileItem) => file.format).filter(Boolean))).sort()); const fallbackFormats = ((data.files || []) as FileItem[])
.map((file) => file.format)
.filter((format) => format.length > 0);
setFormatOptions(Array.from(new Set<string>(fallbackFormats)).sort());
} }
} catch (e) { } catch (e) {
console.error("Failed to fetch files", e); console.error("Failed to fetch files", e);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!