From 7f7d7dbe6654989258f726c31f2a8ea087b00328 Mon Sep 17 00:00:00 2001 From: Apple <> Date: Thu, 16 Jun 2022 09:47:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E3=80=90=E8=90=A5=E9=94=80?= =?UTF-8?q?=E8=AE=A1=E5=88=92-C=E7=AB=AF=E3=80=91key=E7=A0=81=E5=8F=AA?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E4=B8=80=E4=B8=AA=E5=95=86=E5=93=81=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5=E6=9A=82?= =?UTF-8?q?=E5=81=9C=E5=85=91=E6=8D=A2=E7=A0=81=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=AB=8B=E5=8D=B3=E5=85=91=E6=8D=A2=E9=A1=B5=E9=9D=A2=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exchange.html | 11 +++++++---- index.html | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/exchange.html b/exchange.html index 7b5ca53..e9e1ccb 100644 --- a/exchange.html +++ b/exchange.html @@ -292,10 +292,13 @@ window.location.replace('./homepage.html'); }, 3000); } else { - let backUrl = window.history.length; - if (backUrl) { - history.go(-backUrl + 1); - } + // let backUrl = window.history.length; + // if (backUrl) { + // history.go(-backUrl + 1); + // } + /*跳转起始页面*/ + let entryLink=sessionStorage.getItem('entryLink'); + window.location.replace(entryLink); } } } diff --git a/index.html b/index.html index 33c5b7c..44ac964 100644 --- a/index.html +++ b/index.html @@ -150,7 +150,9 @@ sessionStorage.setItem('token', res.data.token); sessionStorage.setItem('haskey', keyCode); this.openDialog('正在加载商品...'); + sessionStorage.setItem('entryLink',window.location.href);//存储起始页链接 window.location.replace("/homepage.html"); + } else { self.openErrorDialog(res.message); } @@ -233,6 +235,7 @@ sessionStorage.setItem('key', self.key); sessionStorage.setItem('token', res.data.token); this.openDialog('正在加载商品...'); + sessionStorage.setItem('entryLink',window.location.href);//存储起始页链接 setTimeout(() => { window.location.href = './homepage.html'; }, 2000); @@ -278,6 +281,7 @@ if (istoGoods) { sessionStorage.setItem('getTokenList', JSON.stringify(getTokenList)); this.openDialog('正在加载商品...'); + sessionStorage.setItem('entryLink',window.location.href);//存储起始页链接 setTimeout(() => { window.location.href = './homepage.html'; }, 2000);