index.js 895 B

123456789101112131415161718192021222324252627282930313233
  1. var init = function () {
  2. var token = localStorage.getItem("token");
  3. if(token){
  4. token = token.substr(1,token.length-2);
  5. }
  6. http.get('/api/tx-manager/admin/setting?access_token='+token, '加载中', function (res) {
  7. for (var key in res) {
  8. var value = res[key];
  9. $("#" + key).text(value);
  10. }
  11. });
  12. http.get('/api/tx-manager/admin/json?access_token='+token, '加载中', function (res) {
  13. $("#redisState").text("正常");
  14. }, function (res) {
  15. $("#redisState").text("异常");
  16. });
  17. http.get('/api/tx-manager/admin/hasCompensate?access_token='+token, '加载中', function (res) {
  18. if (res) {
  19. $("#hasCompensate").text("有");
  20. } else {
  21. $("#hasCompensate").text("无");
  22. }
  23. }, function (res) {
  24. $("#hasCompensate").text("异常");
  25. });
  26. }
  27. init();