Explorar el Código

fix bug by logout cause path exception (#2865)

Soap hace 7 años
padre
commit
f9004b6301
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/models/login.js

+ 2 - 2
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;