From d4b1bd5745ccc4d836979462238d67590809b589 Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Sun, 6 Nov 2016 17:03:46 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E4=BF=AE=E6=94=B9ajax=20post?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin/dist/js/template.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/static/admin/dist/js/template.js b/public/static/admin/dist/js/template.js index 26eaf55..88e37cf 100644 --- a/public/static/admin/dist/js/template.js +++ b/public/static/admin/dist/js/template.js @@ -87,6 +87,7 @@ query = form.serialize(); target = form.attr('action'); $.post(target, query).success(function(data) { + var wait = 1000*data.wait; if (data.code == 1) { if (data.url) { message = data.msg + ' 页面即将自动跳转...'; @@ -94,7 +95,6 @@ message = data.msg; } $.alertMsg(message); - var wait = 1000*data.wait; setTimeout(function() { if (data.url) { location.href = data.url; @@ -104,6 +104,11 @@ }, wait); } else { $.alertMsg(data.msg); + setTimeout(function() { + if (data.url) { + location.href = data.url; + } + }, wait); } }); }