mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 07:26:36 +08:00
[优化] 新增 GeoIP 测试功能,更新相关 API 路由和前端组件
This commit is contained in:
@@ -2,6 +2,7 @@ import { apiRequest } from '@/lib/api/client';
|
||||
|
||||
import type {
|
||||
BootstrapTokenPayload,
|
||||
GeoIPLookupResult,
|
||||
OptionItem,
|
||||
SettingsProfile,
|
||||
UpdateSelfPayload,
|
||||
@@ -18,6 +19,13 @@ export function updateOption(key: string, value: string) {
|
||||
});
|
||||
}
|
||||
|
||||
export function lookupGeoIP(provider: string, ip: string) {
|
||||
return apiRequest<GeoIPLookupResult>('/option/geoip/lookup', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ provider, ip }),
|
||||
});
|
||||
}
|
||||
|
||||
export function getBootstrapToken() {
|
||||
return apiRequest<BootstrapTokenPayload>('/nodes/bootstrap-token');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user