From a1460a97b4e9b81fd93a1db060ec834dd59ab7c4 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Wed, 21 Jan 2026 23:09:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20@kevisual/api=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E8=87=B3=200.0.25=EF=BC=8C=E4=BC=98=E5=8C=96=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=88=9D=E5=A7=8B=E5=8C=96=E5=A4=B1=E8=B4=A5=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- query/query-proxy/router-api-proxy.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index bc600a0..b4e1c87 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/api", - "version": "0.0.24", + "version": "0.0.25", "description": "", "main": "mod.ts", "scripts": { diff --git a/query/query-proxy/router-api-proxy.ts b/query/query-proxy/router-api-proxy.ts index bea5755..5d6c17e 100644 --- a/query/query-proxy/router-api-proxy.ts +++ b/query/query-proxy/router-api-proxy.ts @@ -18,8 +18,10 @@ export const initApi = async (opts: { const query = item?.api?.query || new Query({ url: item?.api?.url || '/api/router' }) const res = await query.post<{ list: RouterItem[] }>({ path: "router", key: 'list', token: token }); if (res.code !== 200) { - console.error('初始化路由失败:', query.url, res.message); - return + return { + code: res.code, + message: `初始化路由失败: ${res.message}, url: ${query.url}` + } } let _list = res.data?.list || [] if (opts?.exclude) { @@ -52,4 +54,8 @@ export const initApi = async (opts: { }).addTo(router); } } + return { + code: 200, + message: '初始化路由成功' + } } \ No newline at end of file