From 16d8b71e21dc7298b30f46bf264cd9b3589a6978 Mon Sep 17 00:00:00 2001 From: who's hu Date: Tue, 22 Aug 2023 09:25:19 +0000 Subject: [PATCH] =?UTF-8?q?update=20ruoyi-ui/src/permission.js.=20?= =?UTF-8?q?=E7=94=B1=E4=BA=8E=E9=87=8D=E5=AE=9A=E5=90=91url=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=20http://xxx.xx.xxx/{id}=3Fparam=3D{a}&name=3D{b}=20?= =?UTF-8?q?=E7=9A=84=E5=9C=BA=E6=99=AF,=20=E5=BD=93=E6=9C=AA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E8=AE=BF=E9=97=AE=E6=97=B6,=20=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=94=B9js=E5=B0=81=E8=A3=85=E7=99=BB=E5=BD=95=E5=90=8E?= =?UTF-8?q?=E9=87=8D=E5=AE=9A=E5=90=91=E5=8F=82=E6=95=B0,=20=E4=BC=9A?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=3F=E5=90=8E=E7=9A=84query=20params=20?= =?UTF-8?q?=E5=A6=82:=20=E8=AE=BF=E9=97=AE=20http://localhost:1024/core/do?= =?UTF-8?q?c/doc=3Fid=3D1683734914907807745&version=3D31=20=E6=9C=9F?= =?UTF-8?q?=E6=9C=9B=20http://localhost:1024/login=3Fredirect=3D%2Fcore%2F?= =?UTF-8?q?doc%2Fdoc%3Fid%3D1683734914907807745%26version%3D31=20=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E9=80=9A=E8=BF=87=20to.fullPath=20=E5=B0=81=E8=A3=85?= =?UTF-8?q?=E5=90=8E=20=E8=8E=B7=E5=BE=97=20http://localhost:1024/login=3F?= =?UTF-8?q?redirect=3D%2Fcore%2Fdoc%2Fdoc%3Fid%3D1683734914907807745&versi?= =?UTF-8?q?on=3D31?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 登录成功跳转到重定向参数url后, 导致version参数丢失. 需要对 to.fullPath 进行一次编码, 以保证重定向前 to.fullPath 的完整性. 通过 ${encodeURIComponent(to.fullPath)} 获得 http://localhost:1024/login?redirect=%2Fcore%2Fdoc%2Fdoc%3Fid%3D1683734914907807745%26version%3D31 完整url Signed-off-by: who's hu --- ruoyi-ui/src/permission.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/src/permission.js b/ruoyi-ui/src/permission.js index 609d215..e1a14da 100644 --- a/ruoyi-ui/src/permission.js +++ b/ruoyi-ui/src/permission.js @@ -45,7 +45,7 @@ router.beforeEach((to, from, next) => { // 在免登录白名单,直接进入 next() } else { - next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 + next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页 NProgress.done() } }