From 98ccf17196382bcc4a2b1d291086ee31e2e2e7ff Mon Sep 17 00:00:00 2001 From: Himself65 Date: Mon, 6 Mar 2023 14:59:49 -0600 Subject: [PATCH] feat: modify prefixUrl in params (#1335) --- apps/web/next.config.mjs | 1 - apps/web/src/shared/apis.ts | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 29463e9202..8fe899a1dc 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -21,7 +21,6 @@ const profileTarget = { stage: '', pro: 'http://pathfinder.affine.pro', local: '127.0.0.1:3000', - rem: 'stage.affine.pro', }; const getRedirectConfig = profile => { diff --git a/apps/web/src/shared/apis.ts b/apps/web/src/shared/apis.ts index bd30f5f159..00b9a9283c 100644 --- a/apps/web/src/shared/apis.ts +++ b/apps/web/src/shared/apis.ts @@ -15,6 +15,9 @@ if (typeof window === 'undefined') { } else { console.warn('serverAPI is not a valid URL', config.serverAPI); } +} else { + const params = new URLSearchParams(window.location.search); + params.get('prefixUrl') && (prefixUrl = params.get('prefixUrl') as string); } const bareAuth = createBareClient(prefixUrl);