diff --git a/src/assets/css/components/tools/store-card.scss b/src/assets/css/components/tools/store-card.scss index c42f825..f5c082e 100644 --- a/src/assets/css/components/tools/store-card.scss +++ b/src/assets/css/components/tools/store-card.scss @@ -32,6 +32,7 @@ gap: 4px; opacity: 0; transition: all 0.2s; + z-index: 100; > *:hover { color: constants.$font-secondary-color; diff --git a/src/components/tools/StoreCard.tsx b/src/components/tools/StoreCard.tsx index 5572658..e2123f4 100644 --- a/src/components/tools/StoreCard.tsx +++ b/src/components/tools/StoreCard.tsx @@ -75,10 +75,9 @@ const StoreCard = ({ } if (platform === 'ANDROID') { void modal.confirm({ + centered: true, icon: , title: 'Android 端', - centered: true, - maskClosable: true, content: ( ) => { e.stopPropagation() void modal.confirm({ + centered: true, icon: , title: 'Android 端', - centered: true, - maskClosable: true, content: ( + 网络错误,请检查网络后重试 + + ), + key: 'NETWORK_ERROR' + }) } else { void message.error({ content: ( diff --git a/src/util/navigation.ts b/src/util/navigation.ts index fceb2fe..4f4b9b0 100644 --- a/src/util/navigation.ts +++ b/src/util/navigation.ts @@ -37,10 +37,15 @@ export const navigateToView = ( version?: string, options?: NavigateOptions ) => { - navigate( - `/view/${username}/${toolId}${version ? `/${version}` : ''}${platform !== import.meta.env.VITE_PLATFORM ? `?platform=${platform}` : ''}`, - options + const url = new URL( + `/view/${username}/${toolId}${version ? `/${version}` : ''}`, + window.location.href ) + if (platform !== import.meta.env.VITE_PLATFORM) { + url.searchParams.append('platform', platform) + } + + navigate(`${url.pathname}${url.search}`, options) } export const navigateToSource = ( @@ -51,10 +56,14 @@ export const navigateToSource = ( version?: string, options?: NavigateOptions ) => { - navigate( - `/source/${username}/${toolId}${version ? `/${version}` : ''}${platform !== import.meta.env.VITE_PLATFORM ? `?platform=${platform}` : ''}`, - options + const url = new URL( + `/source/${username}/${toolId}${version ? `/${version}` : ''}`, + window.location.href ) + if (platform !== import.meta.env.VITE_PLATFORM) { + url.searchParams.append('platform', platform) + } + navigate(`${url.pathname}${url.search}`, options) } export const navigateToRedirect = ( @@ -104,10 +113,12 @@ export const navigateToEdit = ( platform: Platform, options?: NavigateOptions ) => { - navigate( - `/edit/${toolId}${platform !== import.meta.env.VITE_PLATFORM ? `?platform=${platform}` : ''}`, - options - ) + const url = new URL(`/edit/${toolId}`, window.location.href) + if (platform !== import.meta.env.VITE_PLATFORM) { + url.searchParams.append('platform', platform) + } + + navigate(`${url.pathname}${url.search}`, options) } export const navigateToUser = (navigate: NavigateFunction, options?: NavigateOptions) => { @@ -123,5 +134,14 @@ export const getViewPath = ( toolId: string, platform: Platform, version?: string -) => - `/view/${username}/${toolId}${version ? `/${version}` : ''}${platform !== import.meta.env.VITE_PLATFORM ? `?platform=${platform}` : ''}` +) => { + const url = new URL( + `/view/${username}/${toolId}${version ? `/${version}` : ''}`, + window.location.href + ) + if (platform !== import.meta.env.VITE_PLATFORM) { + url.searchParams.append('platform', platform) + } + + return `${url.pathname}${url.search}` +}