diff --git a/rollup.components.config.mjs b/rollup.components.config.mjs index c4481d0e..9be07390 100644 --- a/rollup.components.config.mjs +++ b/rollup.components.config.mjs @@ -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') }, diff --git a/src/components/hooks/useRequireLogin.ts b/src/components/hooks/useRequireLogin.ts index b0d8029d..76460a55 100644 --- a/src/components/hooks/useRequireLogin.ts +++ b/src/components/hooks/useRequireLogin.ts @@ -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`; } }