未验证 提交 d9d8d4fa 编写于 作者: 云深 提交者: GitHub

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

上级 90cbecea
......@@ -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);
}
......
......@@ -33,6 +33,7 @@ interface Window {
fieldsObject: GAFieldsObject | string,
) => void;
reloadAuthorized: () => void;
routerBase: string;
}
declare let ga: () => void;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册