From a926063c7d172a6711cf2d9ce7101d927649019d Mon Sep 17 00:00:00 2001 From: syui Date: Fri, 3 Nov 2023 13:58:32 +0900 Subject: [PATCH] fix --- src/main.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 6de1b4b2..64cfe583 100644 --- a/src/main.ts +++ b/src/main.ts @@ -111,13 +111,24 @@ if (targetY) workerService.trigger('setTargetY', Number(targetY)); const targetZ = searchParams.get('tz'); if (targetZ) workerService.trigger('setTargetZ', Number(targetZ)); +let api_url_local = "https://api.syui.ai/users/" let url = new URL(window.location.href); let params = url.searchParams; -if(params.get('id') != null){ - var api_url = "/api/users/" + params.get('id'); + +if(url.hostname == "localhost"){ + if(params.get('id') != null){ + var api_url = "/api/users/" + params.get('id'); + } else { + var api_url = "/api/users/" + 2; + } } else { - var api_url = "/api/users/" + 2; + if(params.get('id') != null){ + var api_url = api_url_local + params.get('id'); + } else { + var api_url = api_url_local + 2; + } } + let date = new Date(); var num_h = date.getHours(); var test_url = "https://card.syui.ai/obj/"