浏览代码

fix(api): harden resources base url extraction and add debug log

unknown 3 天之前
父节点
当前提交
47f37cf71e
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/lib/api.ts

+ 2 - 1
src/lib/api.ts

@@ -1,7 +1,8 @@
 import i18n from "../i18n";
 
 export const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000';
-export const RESOURCES_BASE_URL = API_BASE_URL.replace(/\/api$/, '');
+export const RESOURCES_BASE_URL = API_BASE_URL.replace(/\/api\/?$/, '');
+console.log("DEBUG: Resources will be loaded from:", RESOURCES_BASE_URL);
 
 const getErrorMessage = async (response: Response, defaultMsg: string) => {
   try {