完成JC-ArtList与JC-Salon端侧清理和统一命名

This commit is contained in:
2026-08-25 16:21:05 +08:00
parent aa93695704
commit abce4a2787
1839 changed files with 653 additions and 50415 deletions
+29
View File
@@ -0,0 +1,29 @@
/**
* Purpose: normalizeBaseUrl supports api.ts by holding or executing the normalize base url page or API role.
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
*/
function normalizeBaseUrl(value: string | undefined, fallbackValue: string) {
const target = String(value || fallbackValue).trim()
return target.replace(/\/+$/, '')
}
/**
* Purpose: DEFAULT_API_BASE_URL supports api.ts by holding or executing the default api base url page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const DEFAULT_API_BASE_URL = import.meta.env.DEV ? '/api' : 'https://yunail.art/api'
/**
* Purpose: API_CONFIG supports api.ts by holding or executing the api config page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
export const API_CONFIG = {
mode: import.meta.env.MODE,
apiBaseUrl: normalizeBaseUrl(import.meta.env.VITE_API_BASE_URL, DEFAULT_API_BASE_URL),
}
/**
* Purpose: API_BASE_URL supports api.ts by holding or executing the api base url page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
export const API_BASE_URL = API_CONFIG.apiBaseUrl