From 0e105c78e118cb0e762b0e9217df43aaeb964924 Mon Sep 17 00:00:00 2001 From: HongxuanG <1359774872@qq.com> Date: Tue, 28 Jul 2026 10:34:23 +0800 Subject: [PATCH] =?UTF-8?q?chore(http):=20=E8=AF=B7=E6=B1=82=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=94=B9=E4=B8=BAJSON=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- src/common/http.interceptor.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/common/http.interceptor.js b/src/common/http.interceptor.js index 2a0b3d4..9ba2bba 100644 --- a/src/common/http.interceptor.js +++ b/src/common/http.interceptor.js @@ -24,9 +24,14 @@ const install = (Vue, vm) => { Vue.prototype.$u.http.interceptor.request = (req) => { const reqUrl = req && req.url ? String(req.url) : ''; const isAbsolute = /^https?:\/\//i.test(reqUrl); - console.log('request', req); - console.log('baseUrl', vm.$store.state.apiurl); - console.log('完整URL', isAbsolute ? reqUrl : (vm.$store.state.apiurl + reqUrl)); + const fullUrl = isAbsolute ? reqUrl : (vm.$store.state.apiurl + reqUrl); + // 用 JSON 字符串输出,避免 HBuilderX 控制台对象被截断、点击 URL 跳浏览器 + console.log('request => ' + JSON.stringify({ + url: fullUrl, + method: req.method, + data: req.data, + header: req.header + }, null, 2)); if (!req.header){ req.header = []; }