From 49d9f4f389a388145df20fa733e235843f8eea13 Mon Sep 17 00:00:00 2001 From: NanamiAdmin Date: Thu, 7 May 2026 19:23:35 +0800 Subject: [PATCH] fix: update app target and improve notification handling - Change APP_TARGET to new server address - Add line break support in notification messages - Include response details in webhook test notifications - Add Content-Type header to webhook requests --- src/utils/functions.js | 3 ++- src/views/Settings.vue | 8 +++++--- vite.config.js | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils/functions.js b/src/utils/functions.js index f8fa60c..d962dba 100644 --- a/src/utils/functions.js +++ b/src/utils/functions.js @@ -36,7 +36,8 @@ function showNotification(message, type = 'info') { cursor: pointer; `; - notification.innerHTML = `${icons[type] || icons.info}${message}`; + const formattedMessage = message.replace(/\n/g, '
'); + notification.innerHTML = `${icons[type] || icons.info}${formattedMessage}`; document.body.appendChild(notification); diff --git a/src/views/Settings.vue b/src/views/Settings.vue index f6cdd38..aa7417a 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -229,7 +229,9 @@ export default { testBody = testBody.replace(/\{\{\s*serviceName\s*\}\}/g, 'superfrpc_test_test'); testBody = testBody.replace(/\{\{\s*exceptionMsg\s*\}\}/g, 'WebHook Test'); - const headers = {}; + const headers = { + 'Content-Type': 'application/json' + }; if (webhookSettings.headers) { webhookSettings.headers.split('\n').forEach(line => { const colonIndex = line.indexOf(':'); @@ -250,9 +252,9 @@ export default { }); if (response.ok) { - showNotification('WebHook test successful', 'success'); + showNotification(`WebHook test successful\nMessage: ${await response.text()}`, 'success'); } else { - showNotification(`WebHook test failed: HTTP ${response.status}`, 'error'); + showNotification(`WebHook test failed: HTTP ${response.status}\nMessage: ${await response.text()}`, 'error'); } } catch (error) { showNotification(`WebHook test failed: ${error.message}`, 'error'); diff --git a/vite.config.js b/vite.config.js index 34894e6..ec11fd8 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' -const APP_TARGET = '192.168.1.19:19090' +const APP_TARGET = '192.168.20.4:19090' export default defineConfig({ define: {