Apply admin login and subscription popup fixes
This commit is contained in:
@@ -53,8 +53,8 @@ import type {
|
||||
import { getRuntimeAdminBaseUrl, normalizeAdminBaseUrl } from '@/lib/runtime-config'
|
||||
|
||||
const envApiBase = normalizeAdminBaseUrl(import.meta.env.VITE_API_BASE)
|
||||
const DEV_API_BASE = 'http://localhost:5150'
|
||||
const PROD_DEFAULT_API_PORT = '5150'
|
||||
const DEV_DEFAULT_API_HOST = '127.0.0.1'
|
||||
|
||||
function getApiBase() {
|
||||
const runtimeApiBase = getRuntimeAdminBaseUrl('apiBaseUrl')
|
||||
@@ -67,11 +67,12 @@ function getApiBase() {
|
||||
}
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
return DEV_API_BASE
|
||||
if (typeof window !== 'undefined') {
|
||||
const { protocol, hostname } = window.location
|
||||
return `${protocol}//${hostname}:${PROD_DEFAULT_API_PORT}`
|
||||
}
|
||||
|
||||
if (typeof window === 'undefined') {
|
||||
return DEV_API_BASE
|
||||
return `http://${DEV_DEFAULT_API_HOST}:${PROD_DEFAULT_API_PORT}`
|
||||
}
|
||||
|
||||
const { protocol, hostname } = window.location
|
||||
|
||||
Reference in New Issue
Block a user