diff --git a/src/api.js b/src/api.js index 0956128..559d6b1 100644 --- a/src/api.js +++ b/src/api.js @@ -1,7 +1,7 @@ import axios from 'axios' -// Go 搜索服务器地址(端口 80,带 CORS) -const BASE = import.meta.env.VITE_API_BASE || 'http://localhost:80' +// 相对路径(由同源 Go 搜索服务器提供),不指定端口 +const BASE = '' export async function fetchRecent(limit = 50) { const { data } = await axios.get(`${BASE}/admin/recent`, { @@ -46,3 +46,4 @@ export async function flushIndex() { }) return data } + diff --git a/src/views/SearchView.vue b/src/views/SearchView.vue index dacedc1..dee3e61 100644 --- a/src/views/SearchView.vue +++ b/src/views/SearchView.vue @@ -1,7 +1,7 @@