[common] refactoring
This commit is contained in:
parent
4afe790e0f
commit
88c62da5f6
|
@ -797,10 +797,12 @@ Common.Utils.getConfigJson = function (url) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Common.Utils.loadConfig = function(url, callback) {
|
Common.Utils.loadConfig = function(url, callback) {
|
||||||
"use strict";
|
fetch(url, {
|
||||||
|
method: 'get',
|
||||||
fetch(url)
|
headers: {
|
||||||
.then(function(response){
|
'Accept': 'application/json',
|
||||||
|
},
|
||||||
|
}).then(function(response){
|
||||||
if ( response.ok )
|
if ( response.ok )
|
||||||
return response.json();
|
return response.json();
|
||||||
else return 'error';
|
else return 'error';
|
||||||
|
|
Loading…
Reference in a new issue