Fixed login redirect.

This commit is contained in:
Mike Cao 2023-10-04 16:36:47 -07:00
parent 367e0ecdf4
commit 5c933d1c4a
2 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ const customResolver = resolve({
const aliasConfig = {
entries: [
{ find: /^app/, replacement: path.resolve('./src/app') },
{ find: /^components/, replacement: path.resolve('./src/components') },
{ find: /^hooks/, replacement: path.resolve('./src/hooks') },
{ find: /^lib/, replacement: path.resolve('./src/lib') },

View File

@ -13,7 +13,7 @@ export function useRequireLogin(handler?: (data?: object) => void) {
setUser(typeof handler === 'function' ? handler(data) : (data as any)?.user);
} catch {
location.href = `${process.env.basePath}/login`;
location.href = `${process.env.basePath || ''}/login`;
}
}