From 80a8d4c97fb16e9f1cab071fa39af9f101eb6e79 Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 23 Mar 2020 17:54:39 +0800 Subject: [PATCH] Update admin.js --- public/static/admin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/static/admin.js b/public/static/admin.js index d1a255ca8..5210583e5 100644 --- a/public/static/admin.js +++ b/public/static/admin.js @@ -764,6 +764,7 @@ $(function () { ' ' + '' }); + var scripts = {}; (function loadprocess(code, that) { that = this, this.$box = $('[data-queue-load=' + code + ']'); if (that.$box.length < 1) return false; @@ -772,7 +773,7 @@ $(function () { this.$percent = that.$box.find('.layui-progress div'); this.setState = function (status, message) { if (message.indexOf('javascript:') === 0) { - window.location.href = message; + } else if (status === 1) { that.$title.html('' + message + ''); that.$percent.addClass('layui-bg-blue').removeClass('layui-bg-green layui-bg-red'); @@ -795,6 +796,9 @@ $(function () { this.line = lines[this.i], this.percent = '[ ' + this.line.progress + '% ] '; if (this.line.message.indexOf('javascript:') === -1) { this.lines.push(this.line.message.indexOf('>>>') > -1 ? this.line.message : this.percent + this.line.message); + } else if (!scripts['_' + code + '_' + this.i]) { + location.href = this.line.message; + scripts['_' + code + '_' + this.i] = true; } } that.$area.val(this.lines.join("\n")), that.$area.animate({scrollTop: that.$area[0].scrollHeight + 'px'}, 200);