model.js 693 B

1234567891011121314151617181920212223242526272829
  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/onlines?access_token='+token, '加载数据...', function (res) {
  7. var list = $("#list");
  8. list.empty();
  9. for (var p in res) {
  10. var obj = res[p];
  11. var tr =
  12. '<tr>' +
  13. '<td>' + obj.model + '</td>' +
  14. '<td>' + obj.uniqueKey + '</td>' +
  15. '<td>' + obj.ipAddress + '</td>' +
  16. '<td>' + obj.channelName + '</td>' +
  17. '</tr>';
  18. list.append(tr);
  19. }
  20. });
  21. };
  22. init();