refactor(core): harden API parsing and improve type safety

This commit is contained in:
LTbinglingfeng
2026-02-08 09:42:00 +08:00
parent 3783bec983
commit 6c2cd761ba
39 changed files with 689 additions and 404 deletions

View File

@@ -10,7 +10,7 @@ export const configFileApi = {
responseType: 'text',
headers: { Accept: 'application/yaml, text/yaml, text/plain' }
});
const data = response.data as any;
const data: unknown = response.data;
if (typeof data === 'string') return data;
if (data === undefined || data === null) return '';
return String(data);