From b3935d108da6769b0baf60c251469edc20546603 Mon Sep 17 00:00:00 2001 From: smail Date: Tue, 8 Sep 2026 22:54:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=97=A5=E5=BF=97=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=AF=B7=E6=B1=82=E6=A8=A1=E5=9D=97=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=B9=B6=E8=A1=A5=E5=85=85=E6=9E=84=E5=BB=BA=E5=9B=9E=E5=BD=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/components/LogSettings/LogSettings.js | 2 +- test/frontend/logs.test.mjs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/components/LogSettings/LogSettings.js b/frontend/src/views/components/LogSettings/LogSettings.js index dd1eef8f..99b44443 100644 --- a/frontend/src/views/components/LogSettings/LogSettings.js +++ b/frontend/src/views/components/LogSettings/LogSettings.js @@ -1,5 +1,5 @@ import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue' -import http from '@/utils/axios' +import { http } from '@/utils/axios' export function useLogs() { const category = ref('config') diff --git a/test/frontend/logs.test.mjs b/test/frontend/logs.test.mjs index 8ca16511..4cbaca14 100644 --- a/test/frontend/logs.test.mjs +++ b/test/frontend/logs.test.mjs @@ -18,6 +18,12 @@ function fixture(get) { return { page, dispose: () => dispose() } } +test('日志页面使用共享 HTTP 客户端的命名导出', () => { + const transport = readFileSync(new URL('../../frontend/src/utils/axios.js', import.meta.url), 'utf8') + assert.match(transport, /export\s*\{\s*http\s*\}/) + assert.match(read('LogSettings.js'), /import\s*\{\s*http\s*\}\s*from\s*['"]@\/utils\/axios['"]/) +}) + test('日志页面模板和样式能编译,详情不使用原始 HTML 渲染', () => { const require = createRequire(new URL('../../frontend/package.json', import.meta.url)) const { parse, compileScript, compileStyle } = require('@vue/compiler-sfc')