From f04461921334e883c63e27032e507332d9aac698 Mon Sep 17 00:00:00 2001 From: "yadong.zhang" Date: Mon, 14 May 2018 14:03:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=BB=9A=E5=8A=A8=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog-web/src/main/resources/static/js/zhyd.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/blog-web/src/main/resources/static/js/zhyd.js b/blog-web/src/main/resources/static/js/zhyd.js index 497f988..39ecad8 100644 --- a/blog-web/src/main/resources/static/js/zhyd.js +++ b/blog-web/src/main/resources/static/js/zhyd.js @@ -330,4 +330,24 @@ $(function () { window.location.href = action; } }); + + /* 首页通知 */ + if($('#notice-box') && $('#notice-box')[0]){ + $.ajax({ + type: "post", + url: "/api/listNotice", + success: function (json) { + if(json.status == 200 && json.data && json.data.length > 0){ + var tpl = '{{#data}}
  • ' + + '{{&content}}' + + '
  • {{/data}}'; + var html = Mustache.render(tpl, json); + $("#notice-box").html(html); + } + }, + error: function () { + $.tool.ajaxError(); + } + }); + } }); -- GitLab