Skip to content

Commit 01d1fea

Browse files
authored
Update 明文源吗
1 parent 14ac22f commit 01d1fea

File tree

1 file changed

+7
-94
lines changed

1 file changed

+7
-94
lines changed

明文源吗

Lines changed: 7 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,11 +1179,6 @@
11791179
}
11801180
if (url.pathname.includes('/sub')) {
11811181
const pathParts = url.pathname.split('/');
1182-
// 允许通过URL参数自定义UUID和Host
1183-
if (url.searchParams.has('uuid') && url.searchParams.has('host')) {
1184-
return await handleSubscriptionRequest(request, url.searchParams.get('uuid'), url);
1185-
}
1186-
11871182
if (pathParts.length === 2 && pathParts[1] === 'sub') {
11881183
const user = pathParts[0].substring(1);
11891184
if (isValidFormat(user)) {
@@ -1220,13 +1215,8 @@
12201215
async function handleSubscriptionRequest(request, user, url = null) {
12211216
if (!url) url = new URL(request.url);
12221217

1223-
// 优先使用URL参数中的值
1224-
if (url.searchParams.has('uuid')) {
1225-
user = url.searchParams.get('uuid');
1226-
}
1227-
12281218
const finalLinks = [];
1229-
const workerDomain = url.searchParams.get('host') || url.hostname;
1219+
const workerDomain = url.hostname;
12301220
const target = url.searchParams.get('target') || 'base64';
12311221

12321222
async function addNodesFromList(list) {
@@ -1877,14 +1867,9 @@
18771867
}
18781868

18791869
async function handleSubscriptionPage(request, user = null) {
1880-
const url = new URL(request.url);
1881-
// 如果 URL 包含 host 参数,优先使用 URL 参数中的 UUID
1882-
if (url.searchParams.has('host') && url.searchParams.has('uuid')) {
1883-
user = url.searchParams.get('uuid');
1884-
} else if (!user) {
1885-
user = at;
1886-
}
1870+
if (!user) user = at;
18871871

1872+
const url = new URL(request.url);
18881873
// 优先检查Cookie中的语言设置
18891874
const cookieHeader = request.headers.get('Cookie') || '';
18901875
let langFromCookie = null;
@@ -1993,7 +1978,7 @@
19931978
KR: '🇰🇷 韩国', DE: '🇩🇪 德国', SE: '🇸🇪 瑞典', NL: '🇳🇱 荷兰',
19941979
FI: '🇫🇮 芬兰', GB: '🇬🇧 英国'
19951980
},
1996-
terminal: '终端 v2.7',
1981+
terminal: '终端 v2.6',
19971982
githubProject: 'GitHub 项目',
19981983
autoDetectClient: '自动识别',
19991984
selectionLogicText: '同地区 → 邻近地区 → 其他地区',
@@ -2100,7 +2085,7 @@
21002085
KR: '🇰🇷 کره جنوبی', DE: '🇩🇪 آلمان', SE: '🇸🇪 سوئد', NL: '🇳🇱 هلند',
21012086
FI: '🇫🇮 فنلاند', GB: '🇬🇧 بریتانیا'
21022087
},
2103-
terminal: 'ترمینال v2.7',
2088+
terminal: 'ترمینال v2.5.0',
21042089
githubProject: 'پروژه GitHub',
21052090
autoDetectClient: 'تشخیص خودکار',
21062091
selectionLogicText: 'هم‌منطقه → منطقه مجاور → سایر مناطق',
@@ -2393,27 +2378,6 @@
23932378
<div id="selectionLogic" style="margin: 8px 0; color: #00aa00; font-family: 'Courier New', monospace; font-size: 0.9rem; text-shadow: 0 0 3px #00aa00;">${t.selectionLogic}${t.selectionLogicText}</div>
23942379
</div>
23952380
</div>
2396-
2397-
<div class="card">
2398-
<h2 class="card-title">${t.customSubscription}</h2>
2399-
<div style="margin-bottom: 15px;">
2400-
<p style="color: #00aa00; margin-bottom: 10px; font-size: 0.9rem;">${t.customSubscriptionHint}</p>
2401-
<label style="color: #00ff00; display: block; margin-bottom: 8px; font-weight: bold; text-shadow: 0 0 3px #00ff00;">${t.customUUID}</label>
2402-
<div style="display: flex; gap: 10px;">
2403-
<input type="text" id="custom-uuid" style="flex: 1; padding: 12px; background: rgba(0, 0, 0, 0.8); border: 2px solid #00ff00; color: #00ff00; font-family: 'Courier New', monospace; font-size: 14px;" placeholder="UUID">
2404-
<button onclick="generateUUID()" style="background: rgba(0, 255, 0, 0.15); border: 2px solid #00ff00; padding: 12px 20px; color: #00ff00; cursor: pointer; font-weight: bold;">${t.randomUUID}</button>
2405-
</div>
2406-
<small style="color: #00aa00; font-size: 0.85rem;">${t.customUUIDHint}</small>
2407-
</div>
2408-
<div style="margin-bottom: 15px;">
2409-
<label style="color: #00ff00; display: block; margin-bottom: 8px; font-weight: bold; text-shadow: 0 0 3px #00ff00;">${t.customHost}</label>
2410-
<input type="text" id="custom-host" style="width: 100%; padding: 12px; background: rgba(0, 0, 0, 0.8); border: 2px solid #00ff00; color: #00ff00; font-family: 'Courier New', monospace; font-size: 14px;" placeholder="${t.customHostPlaceholder}">
2411-
<small style="color: #00aa00; font-size: 0.85rem;">${t.customHostHint}</small>
2412-
</div>
2413-
<button onclick="generateSubLink()" style="width: 100%; background: rgba(0, 255, 0, 0.15); border: 2px solid #00ff00; padding: 12px; color: #00ff00; font-family: 'Courier New', monospace; font-weight: bold; cursor: pointer; margin-bottom: 10px; text-shadow: 0 0 8px #00ff00; transition: all 0.4s ease;">${t.generateLink}</button>
2414-
<p style="color: #00aa00; font-size: 0.85rem; text-align: center;">${t.accessNewPanel}</p>
2415-
</div>
2416-
</div>
24172381
<div class="card" id="configCard" style="display: none;">
24182382
<h2 class="card-title">${t.configManagement}</h2>
24192383
<div id="kvStatus" style="margin-bottom: 20px; padding: 10px; background: rgba(0, 20, 0, 0.8); border: 1px solid #00ff00; color: #00ff00;">
@@ -3189,18 +3153,7 @@
31893153
kvCheckFailed: '⚠️ KV存储检测失败',
31903154
kvCheckFailedFormat: 'KV存储检测失败: 响应格式错误',
31913155
kvCheckFailedStatus: 'KV存储检测失败 - 状态码: ',
3192-
kvCheckFailedError: 'KV存储检测失败 - 错误: ',
3193-
customSubscription: '自选优选订阅',
3194-
customUUID: '自定义UUID:',
3195-
randomUUID: '随机生成',
3196-
customHost: '优选域名 (Host):',
3197-
customHostPlaceholder: '例如: cdn.example.com',
3198-
generateLink: '访问新订阅面板',
3199-
fillRequired: '请填写 UUID 和 域名',
3200-
customSubscriptionHint: '生成临时订阅链接,用于访问包含特定优选域名的订阅面板。',
3201-
customUUIDHint: 'UUID:您的用户ID,用于验证身份。',
3202-
customHostHint: '优选域名 (Host):您的 Cloudflare 优选域名/IP。',
3203-
accessNewPanel: '点击访问后,将跳转到带有新参数的面板,您可以直接在其中使用一键导入功能。'
3156+
kvCheckFailedError: 'KV存储检测失败 - 错误: '
32043157
},
32053158
fa: {
32063159
kvDisabled: '⚠️ ذخیره‌سازی KV فعال نیست یا پیکربندی نشده است',
@@ -3210,18 +3163,7 @@
32103163
kvCheckFailed: '⚠️ بررسی ذخیره‌سازی KV ناموفق',
32113164
kvCheckFailedFormat: 'بررسی ذخیره‌سازی KV ناموفق: خطای فرمت پاسخ',
32123165
kvCheckFailedStatus: 'بررسی ذخیره‌سازی KV ناموفق - کد وضعیت: ',
3213-
kvCheckFailedError: 'بررسی ذخیره‌سازی KV ناموفق - خطا: ',
3214-
customSubscription: 'اشتراک سفارشی',
3215-
customUUID: 'UUID سفارشی:',
3216-
randomUUID: 'تولید تصادفی',
3217-
customHost: 'دامنه ترجیحی (Host):',
3218-
customHostPlaceholder: 'مثال: cdn.example.com',
3219-
generateLink: 'دسترسی به پنل اشتراک جدید',
3220-
fillRequired: 'لطفا UUID و دامنه را پر کنید',
3221-
customSubscriptionHint: 'ایجاد لینک اشتراک موقت برای دسترسی به پنل اشتراک با دامنه ترجیحی خاص.',
3222-
customUUIDHint: 'UUID: شناسه کاربری شما برای احراز هویت.',
3223-
customHostHint: 'دامنه ترجیحی (Host): دامنه/IP ترجیحی Cloudflare شما.',
3224-
accessNewPanel: 'پس از کلیک برای دسترسی، به پنل با پارامترهای جدید هدایت خواهید شد، جایی که می‌توانید مستقیماً از ویژگی وارد کردن با یک کلیک استفاده کنید.'
3166+
kvCheckFailedError: 'بررسی ذخیره‌سازی KV ناموفق - خطا: '
32253167
}
32263168
};
32273169

@@ -3540,35 +3482,6 @@
35403482
}
35413483
}
35423484
}
3543-
3544-
function generateUUID() {
3545-
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
3546-
var r = Math.random() * 16 | 0;
3547-
var v = c == 'x' ? r : (r & 0x3 | 0x8);
3548-
return v.toString(16);
3549-
});
3550-
document.getElementById('custom-uuid').value = uuid;
3551-
}
3552-
3553-
function generateSubLink() {
3554-
var uuid = document.getElementById('custom-uuid').value.trim();
3555-
var host = document.getElementById('custom-host').value.trim();
3556-
3557-
if (!uuid || !host) {
3558-
alert(t.fillRequired);
3559-
return;
3560-
}
3561-
3562-
var currentPath = window.location.pathname;
3563-
var currentUrl = window.location.origin;
3564-
var newPanelUrl = new URL(currentUrl + currentPath);
3565-
newPanelUrl.searchParams.set('uuid', uuid);
3566-
newPanelUrl.searchParams.set('host', host);
3567-
3568-
// 跳转到带有新参数的面板页面
3569-
window.location.href = newPanelUrl.toString();
3570-
}
3571-
35723485

35733486
document.addEventListener('DOMContentLoaded', function() {
35743487
createMatrixRain();

0 commit comments

Comments
 (0)