From f9004b6301e10f9ba035a2a97452f8b10c45b01c Mon Sep 17 00:00:00 2001 From: Soap <996586214@qq.com> Date: Thu, 15 Nov 2018 14:45:56 +0800 Subject: [PATCH] fix bug by logout cause path exception (#2865) --- src/models/login.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/login.js b/src/models/login.js index d38465d0..fffc5197 100644 --- a/src/models/login.js +++ b/src/models/login.js @@ -29,8 +29,8 @@ export default { const redirectUrlParams = new URL(redirect); if (redirectUrlParams.origin === urlParams.origin) { redirect = redirect.substr(urlParams.origin.length); - if (redirect.startsWith('/#')) { - redirect = redirect.substr(2); + if (redirect.match(/^\/.*#/)) { + redirect = redirect.substr(redirect.indexOf('#')+1); } } else { window.location.href = redirect; -- GitLab