diff --git a/src/client/public/index.html b/src/client/public/index.html
index 02cbe7f..62dc6a1 100644
--- a/src/client/public/index.html
+++ b/src/client/public/index.html
@@ -412,6 +412,25 @@
.modal-btn:active {
transform: scale(0.98);
}
+
+ /* === 加密类型标签样式 === */
+ .crypto-badge {
+ display: inline-block;
+ padding: 2px 8px;
+ border-radius: 4px;
+ font-size: 11px;
+ font-weight: 600;
+ letter-spacing: 0.3px;
+ margin-left: 6px;
+ vertical-align: middle;
+ line-height: 1.5;
+ }
+ .crypto-badge-eapi { background: #fce4e4; color: #C20C0C; border: 1px solid #f5c6c6; }
+ .crypto-badge-xeapi { background: #fef0db; color: #d35400; border: 1px solid #fde2b6; }
+ .crypto-badge-linuxapi { background: #dbeafe; color: #1a56db; border: 1px solid #bdd9fc; }
+ .crypto-badge-weapi { background: #d4edda; color: #1e7e34; border: 1px solid #b8dfc6; }
+ .crypto-badge-api { background: #e9ecef; color: #495057; border: 1px solid #ced4da; }
+ .crypto-badge-unknown { background: #f8f9fa; color: #adb5bd; border: 1px solid #dee2e6; }
@@ -498,13 +517,16 @@
countEl.textContent = capturedData.length;
- container.innerHTML = capturedData.map((item, index) => `
-
-
${escapeHtml(item.path)}
-
${formatTime(item.timestamp)}
-
- `).join('');
+ container.innerHTML = capturedData.map((item, index) => {
+ const cryptoLabel = item.crypto ? getCryptoLabel(item.crypto) : '';
+ return `
+
+
${escapeHtml(item.path)} ${cryptoLabel}
+
${formatTime(item.timestamp)}
+
+ `;
+ }).join('');
}
function selectCapture(index) {
@@ -524,11 +546,14 @@
}
const filteredParam = filterParam(item.param);
+ const cryptoLabel = item.crypto ? getCryptoLabel(item.crypto) : '';
+ const cryptoName = item.crypto ? getCryptoName(item.crypto) : '';
detailPanel.innerHTML = `
@@ -607,6 +632,29 @@
return div.innerHTML;
}
+ function getCryptoLabel(crypto) {
+ const names = {
+ eapi: 'EAPI',
+ xeapi: 'XEAPI',
+ linuxapi: 'LinuxAPI',
+ weapi: 'WEAPI',
+ api: 'API',
+ };
+ const label = names[crypto] || (crypto ? crypto.toUpperCase() : '');
+ return label ? `${label}` : '';
+ }
+
+ function getCryptoName(crypto) {
+ const names = {
+ eapi: 'EAPI (AES-128-ECB)',
+ xeapi: 'XEAPI (AES-128-ECB)',
+ linuxapi: 'LinuxAPI (AES-128-ECB)',
+ weapi: 'WEAPI (RSA + AES)',
+ api: 'API (未加密)',
+ };
+ return names[crypto] || crypto || '未知';
+ }
+
function fetchVersion() {
fetch('/api/version')
.then(response => response.json())
diff --git a/src/server/hook.js b/src/server/hook.js
index c575237..b13665b 100644
--- a/src/server/hook.js
+++ b/src/server/hook.js
@@ -268,6 +268,7 @@ hook.request.before = (ctx) => {
) {
req.headers['X-Real-IP'] = '118.88.88.88';
ctx.netease = {
+ crypto: url.path.startsWith('/weapi/') ? 'weapi' : 'api',
web: true,
path: url.path
.replace(/^\/weapi\//, '/api/')
@@ -327,6 +328,7 @@ hook.request.after = (ctx) => {
const dataToSend = {
timestamp: new Date().toISOString(),
path: netease.path,
+ crypto: netease.crypto || null,
param: netease.param,
response: netease.jsonBody,
statusCode: proxyRes.statusCode
@@ -339,6 +341,7 @@ hook.request.after = (ctx) => {
const dataToSend = {
timestamp: new Date().toISOString(),
path: netease.path,
+ crypto: netease.crypto || null,
param: netease.param,
response: null,
statusCode: proxyRes.statusCode,