update: 跳转

main
fadeaway 6 months ago
parent 76e70584ad
commit df8c5ccd55

@ -7,7 +7,7 @@ import useNav from '@/hooks/useNav';
export default function InviteBanner() { export default function InviteBanner() {
const nav = useNav(); const nav = useNav();
const handleClick = () => { const handleClick = () => {
nav.push({ path: '/index' }); nav.push({ path: '/' });
}; };
return ( return (
<div <div

@ -21,7 +21,7 @@ export default function useNav() {
queryStr += `?${queryArr.join('&')}`; queryStr += `?${queryArr.join('&')}`;
} }
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
window.location.href = `${path}.html${queryStr}`; window.location.href = `${path === '/' ? '/index' : path}.html${queryStr}`;
} else { } else {
router.push(`${path}${queryStr}`); router.push(`${path}${queryStr}`);
} }

Loading…
Cancel
Save