🐛 fix: update API prefix handling to ensure compatibility with undefined VITE_API_PREFIX

This commit is contained in:
web
2025-12-12 09:11:42 -08:00
parent 6a70eab2e9
commit 3920c6ff59
29 changed files with 311 additions and 251 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ export async function appleLoginCallback(
});
return request<API.Response & { data?: any }>(
`${import.meta.env.VITE_API_PREFIX}/v1/auth/oauth/callback/apple`,
`${import.meta.env.VITE_API_PREFIX || ""}/v1/auth/oauth/callback/apple`,
{
method: "POST",
data: formData,
@@ -49,7 +49,7 @@ export async function oAuthLogin(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.OAuthLoginResponse }>(
`${import.meta.env.VITE_API_PREFIX}/v1/auth/oauth/login`,
`${import.meta.env.VITE_API_PREFIX || ""}/v1/auth/oauth/login`,
{
method: "POST",
headers: {
@@ -67,7 +67,7 @@ export async function oAuthLoginGetToken(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.LoginResponse }>(
`${import.meta.env.VITE_API_PREFIX}/v1/auth/oauth/login/token`,
`${import.meta.env.VITE_API_PREFIX || ""}/v1/auth/oauth/login/token`,
{
method: "POST",
headers: {