fix:修复渲染报错

This commit is contained in:
Daniel
2026-03-08 21:57:02 +08:00
parent b05ebb80fa
commit 37203a1964

View File

@@ -428,7 +428,9 @@
});
}
fetch('api.config.json').catch(function() { return { json: function() { return Promise.resolve({ apiBase: '' }); }; }; })
fetch('api.config.json').catch(function() {
return { json: function() { return Promise.resolve({ apiBase: '' }); } };
})
.then(function(r) { return typeof r.json === 'function' ? r.json() : Promise.resolve({ apiBase: '' }); })
.then(function(apiConfig) {
API = (apiConfig.apiBase || '').replace(/\/$/, '') + '/api';