fix:修复
This commit is contained in:
@@ -428,10 +428,12 @@
|
||||
});
|
||||
}
|
||||
|
||||
fetch('api.config.json').catch(function() {
|
||||
return { json: function() { return Promise.resolve({ apiBase: '' }); } };
|
||||
fetch('api.config.json')
|
||||
.then(function(r) {
|
||||
if (!r.ok) return Promise.resolve({ apiBase: '' });
|
||||
return typeof r.json === 'function' ? r.json().catch(function() { return { apiBase: '' }; }) : Promise.resolve({ apiBase: '' });
|
||||
})
|
||||
.then(function(r) { return typeof r.json === 'function' ? r.json() : Promise.resolve({ apiBase: '' }); })
|
||||
.catch(function() { return Promise.resolve({ apiBase: '' }); })
|
||||
.then(function(apiConfig) {
|
||||
API = (apiConfig.apiBase || '').replace(/\/$/, '') + '/api';
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
Reference in New Issue
Block a user