version.js 541 B

1234567891011121314151617181920
  1. const {post, config} = require('./promise.js');
  2. const $ = require("jquery");
  3. $(function(){
  4. function getVersion() {
  5. post(config.getVersion, '').then((res) => {
  6. const data = res.data.data;
  7. const dtl = data.detail;
  8. const time = data.refreshTime.substr(0,10);
  9. let dom = '';
  10. $("h1 span").html(data.name);
  11. $("h1 i").html(time);
  12. for(let i=0;i<dtl.length;i++){
  13. dom += '<p>'+dtl[i].title+'</p><p>'+dtl[i].description+'</p>';
  14. }
  15. $(".content").html(dom);
  16. })
  17. }
  18. getVersion();
  19. })