Update storage.js via upload script - 2026-08-13 11:00:10

This commit is contained in:
mike 2026-08-13 11:00:27 +08:00
parent dabe7e71da
commit 7c37a4e171
1 changed files with 0 additions and 42 deletions

View File

@ -164,46 +164,4 @@ export async function translateTerms(terms, targetLang) {
return data.translations;
}
/* ------------------------------ Telegram config ---------------------------- */
export async function getTelegramConfig() {
const res = await fetch('/api/telegram-config');
return res.json().catch(() => ({ hasToken: false, chatId: '' }));
}
export async function saveTelegramConfig(botToken, chatId) {
const res = await fetch('/api/telegram-config', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ botToken, chatId }),
});
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(data.error || 'save failed');
return data;
}
export async function deleteTelegramConfig() {
const res = await fetch('/api/telegram-config', { method: 'DELETE' });
return res.json().catch(() => ({}));
}
export async function testTelegramConfig() {
const res = await fetch('/api/telegram-config/test', { method: 'POST' });
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(data.error || 'test failed');
return data;
}
/* --------------------------------- JMS api --------------------------------- */
// 对单条线路立即做一次连通性检测SS/VMess/VLESS Reality走TCP测试VLESS-CDN走HTTP状态码+真实WS握手
export async function checkJmsLine(line) {
const res = await fetch('/api/jms/check-line', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ line }),
});
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(data.error || 'check failed');
return data; // { status: 'normal' | 'abnormal', checkedAt }
}