Signed-off-by: 吴文峰 <kevin@lmve.net>
This commit is contained in:
+48
@@ -0,0 +1,48 @@
|
||||
import axios from 'axios'
|
||||
|
||||
// Go 搜索服务器地址(端口 80,带 CORS)
|
||||
const BASE = import.meta.env.VITE_API_BASE || 'http://localhost:80'
|
||||
|
||||
export async function fetchRecent(limit = 50) {
|
||||
const { data } = await axios.get(`${BASE}/admin/recent`, {
|
||||
params: { limit },
|
||||
timeout: 15000,
|
||||
})
|
||||
return data
|
||||
}
|
||||
|
||||
export async function fetchStats() {
|
||||
const { data } = await axios.get(`${BASE}/admin/stats`, {
|
||||
timeout: 15000,
|
||||
})
|
||||
return data
|
||||
}
|
||||
|
||||
export async function fetchPriority() {
|
||||
const { data } = await axios.get(`${BASE}/admin/priority`, {
|
||||
timeout: 15000,
|
||||
})
|
||||
return data
|
||||
}
|
||||
|
||||
export async function addPriority(url) {
|
||||
const { data } = await axios.post(`${BASE}/admin/priority`, { url }, {
|
||||
timeout: 15000,
|
||||
})
|
||||
return data
|
||||
}
|
||||
|
||||
export async function removePriority(url) {
|
||||
const { data } = await axios.delete(`${BASE}/admin/priority`, {
|
||||
params: { url },
|
||||
timeout: 15000,
|
||||
})
|
||||
return data
|
||||
}
|
||||
|
||||
export async function flushIndex() {
|
||||
const { data } = await axios.post(`${BASE}/admin/flush`, null, {
|
||||
timeout: 60000,
|
||||
})
|
||||
return data
|
||||
}
|
||||
Reference in New Issue
Block a user