fix: 完善 API Token 验收细节
This commit is contained in:
@@ -357,13 +357,17 @@ function parseFilename(disposition: string | null): string {
|
||||
return plainMatch?.[1] || '';
|
||||
}
|
||||
|
||||
function apiUrl(url: string): string {
|
||||
export function apiUrl(url: string): string {
|
||||
if (!API_BASE || /^https?:\/\//i.test(url)) {
|
||||
return url;
|
||||
}
|
||||
return `${API_BASE}${url.startsWith('/') ? url : `/${url}`}`;
|
||||
}
|
||||
|
||||
export function getApiBaseUrl(): string {
|
||||
return API_BASE || window.location.origin;
|
||||
}
|
||||
|
||||
function resolveApiBase(): string {
|
||||
const configured = (import.meta.env.VITE_API_BASE || '').replace(/\/$/, '');
|
||||
if (configured) {
|
||||
|
||||
Reference in New Issue
Block a user