- 图标优化、视频缩略图
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
// API 基地址:Tauri 生产环境使用绝对路径,浏览器环境使用相对路径
|
||||
// 导出供 SSE、媒体文件等非 fetch 场景使用
|
||||
const BASE = window.location.protocol === 'http:' || window.location.protocol === 'https:'
|
||||
? '' // 浏览器环境 — 同源请求
|
||||
: 'http://localhost:10801'; // Tauri 生产环境 (tauri://)
|
||||
export const API_BASE = BASE;
|
||||
|
||||
async function request(url, options = {}) {
|
||||
const res = await fetch(`${BASE}${url}`, {
|
||||
|
||||
Reference in New Issue
Block a user