Browse Source

fix: redirect with deploy on non-root path (#8141)

pull/8212/head
云深 5 years ago
committed by GitHub
parent
commit
d9d8d4fa6e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/models/login.ts
  2. 1
      src/typings.d.ts

3
src/models/login.ts

@ -49,6 +49,9 @@ const Model: LoginModelType = {
const redirectUrlParams = new URL(redirect);
if (redirectUrlParams.origin === urlParams.origin) {
redirect = redirect.substr(urlParams.origin.length);
if (window.routerBase !== '/') {
redirect = redirect.replace(window.routerBase, '/');
}
if (redirect.match(/^\/.*#/)) {
redirect = redirect.substr(redirect.indexOf('#') + 1);
}

1
src/typings.d.ts

@ -33,6 +33,7 @@ interface Window {
fieldsObject: GAFieldsObject | string,
) => void;
reloadAuthorized: () => void;
routerBase: string;
}
declare let ga: () => void;

Loading…
Cancel
Save