Update storage.js via upload script - 2026-08-01 00:10:08
This commit is contained in:
parent
4f93f9b480
commit
3292dd7552
13
storage.js
13
storage.js
|
|
@ -207,16 +207,3 @@ export async function checkJmsLine(line) {
|
|||
if (!res.ok) throw new Error(data.error || 'check failed');
|
||||
return data; // { status: 'normal' | 'abnormal', checkedAt }
|
||||
}
|
||||
|
||||
// 让服务器代为请求JMS的标准订阅地址,解析Subscription-Userinfo拿到流量信息
|
||||
// (浏览器直接fetch会被CORS挡住,服务器端没有这个限制)
|
||||
export async function fetchJmsTraffic(subscriptionUrl) {
|
||||
const res = await fetch('/api/jms/fetch-traffic', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ subscriptionUrl }),
|
||||
});
|
||||
const data = await res.json().catch(() => ({}));
|
||||
if (!res.ok) throw new Error(data.error || 'fetch traffic failed');
|
||||
return data; // { ok, upload, download, total, expire } 或 { ok:false, error }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue