From 734c0fda04aaa8860c079449e9eb9426d6d5308b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 3 Nov 2022 10:15:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0notify=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/static/admin.js b/public/static/admin.js index 53eb26b9b..54d4bc9b3 100644 --- a/public/static/admin.js +++ b/public/static/admin.js @@ -188,6 +188,13 @@ $(function () { var idx = msg ? layer.msg(msg, {icon: 16, scrollbar: false, shade: this.shade, time: 0, end: call}) : layer.load(2, {time: 0, scrollbar: false, shade: this.shade, end: call}); return $.msg.idx.push(idx), idx; }; + /*! Notify 调用入口 */ + // https://www.jq22.com/demo/jquerygrowl-notification202104021049 + this.notify = function (title, msg, time, option) { + require(['notify'], function (Notify) { + Notify.notify(Object.assign({title: title || '', description: msg || '', position: 'top-right', closeTimeout: time || 3000}, (option || {}))); + }); + }; /*! 页面加载层 */ this.page = new function () { this.$body = $('body>.think-page-loader');