From f55eac12495b9c3ac6261daef5a1ad187487af94 Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Sat, 11 May 2024 16:37:22 +0800 Subject: [PATCH] Refactor(StoreCard): Optimize android qr-code url --- src/components/tools/StoreCard.tsx | 11 +++-------- src/util/navigation.ts | 3 +++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/tools/StoreCard.tsx b/src/components/tools/StoreCard.tsx index e2123f4..c16e3d4 100644 --- a/src/components/tools/StoreCard.tsx +++ b/src/components/tools/StoreCard.tsx @@ -7,6 +7,7 @@ import { COLOR_BACKGROUND, COLOR_MAIN, COLOR_PRODUCTION } from '@/constants/comm import { checkDesktop, omitText } from '@/util/common' import { getLoginStatus, getUserId } from '@/util/auth' import { + getAndroidUrl, navigateToLogin, navigateToSource, navigateToStore, @@ -80,10 +81,7 @@ const StoreCard = ({ title: 'Android 端', content: ( - + 请使用手机端扫描上方二维码 ), @@ -151,10 +149,7 @@ const StoreCard = ({ title: 'Android 端', content: ( - + 请使用手机端扫描上方二维码 ), diff --git a/src/util/navigation.ts b/src/util/navigation.ts index 4f4b9b0..19da234 100644 --- a/src/util/navigation.ts +++ b/src/util/navigation.ts @@ -145,3 +145,6 @@ export const getViewPath = ( return `${url.pathname}${url.search}` } + +export const getAndroidUrl = (username: string, toolId: string) => + `oxygen://opentool/${username}/${toolId}` -- 2.49.1