From 191762002b27bab1e4d61ca6d651b9054539de65 Mon Sep 17 00:00:00 2001 From: superpants <2855475870@qq.com> Date: Wed, 31 Mar 2021 22:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ws=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/cart.jsp | 20 +++++++++++++++++++- src/main/webapp/main.jsp | 23 ++++++++++++++++++++--- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/cart.jsp b/src/main/webapp/cart.jsp index 1aca7a4..f3e6edf 100644 --- a/src/main/webapp/cart.jsp +++ b/src/main/webapp/cart.jsp @@ -68,6 +68,8 @@ + + diff --git a/src/main/webapp/main.jsp b/src/main/webapp/main.jsp index 47db341..91152ae 100644 --- a/src/main/webapp/main.jsp +++ b/src/main/webapp/main.jsp @@ -65,7 +65,8 @@ 购买 - 添加到购物车 + 添加到购物车 @@ -119,9 +120,25 @@ }; ws.onmessage = ev => { let data = JSON.parse(ev.data); - console.log(data); + let message = "" + + "" + data.message.toString() + + ""; if (data.flag == "SSO") { - window.location.href = "/login.jsp" + console.log(data); + layer.open({ + type: 1, + title: false, + closeBtn: 0, //不显示关闭按钮 + shade: [0], + area: ['340px', '215px'], + offset: 'rb', //右下角弹出 + time: 2000, //2秒后自动关闭 + anim: 2, + content: message, //iframe的url,no代表不显示滚动条 + end: function () { //此处用于演示 + window.location.href = "/main.jsp" + } + }); } }; -- Gitee