var init = function () { var token = localStorage.getItem("token"); if(token){ token = token.substr(1,token.length-2); } http.get('/api/tx-manager/admin/setting?access_token='+token, '加载中', function (res) { for (var key in res) { var value = res[key]; $("#" + key).text(value); } }); http.get('/api/tx-manager/admin/json?access_token='+token, '加载中', function (res) { $("#redisState").text("正常"); }, function (res) { $("#redisState").text("异常"); }); http.get('/api/tx-manager/admin/hasCompensate?access_token='+token, '加载中', function (res) { if (res) { $("#hasCompensate").text("有"); } else { $("#hasCompensate").text("无"); } }, function (res) { $("#hasCompensate").text("异常"); }); } init();