From 7c37a4e171bb0f4eedb3f960a10eb25cbf53949d Mon Sep 17 00:00:00 2001 From: mike Date: Thu, 13 Aug 2026 11:00:27 +0800 Subject: [PATCH] Update storage.js via upload script - 2026-08-13 11:00:10 --- storage.js | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/storage.js b/storage.js index e14fa7e..a3c4dca 100644 --- a/storage.js +++ b/storage.js @@ -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 } -}