mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-21 08:52:43 +08:00
fix: 修改getCloudflareUsage函数中的错误处理逻辑,确保返回默认值而非抛出错误
This commit is contained in:
@@ -1509,7 +1509,7 @@ async function getCloudflareUsage(Email, GlobalAPIKey, AccountID, APIToken) {
|
||||
const cfg = { "Content-Type": "application/json" };
|
||||
|
||||
try {
|
||||
if (!AccountID && (!Email || !GlobalAPIKey)) throw new Error("请提供账户ID或API密钥");
|
||||
if (!AccountID && (!Email || !GlobalAPIKey)) return { success: false, pages: 0, workers: 0, total: 0 };
|
||||
|
||||
if (!AccountID) {
|
||||
const r = await fetch(`${API}/accounts`, {
|
||||
|
||||
Reference in New Issue
Block a user