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 = []; }