Compare commits

...

2 Commits

Author SHA1 Message Date
12187283cc fix(storegoods): 扫码超25位判为二维码
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-28 10:34:23 +08:00
0e105c78e1 chore(http): 请求日志改为JSON字符串输出
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-28 10:34:23 +08:00
3 changed files with 12 additions and 7 deletions

View File

@ -24,9 +24,14 @@ const install = (Vue, vm) => {
Vue.prototype.$u.http.interceptor.request = (req) => { Vue.prototype.$u.http.interceptor.request = (req) => {
const reqUrl = req && req.url ? String(req.url) : ''; const reqUrl = req && req.url ? String(req.url) : '';
const isAbsolute = /^https?:\/\//i.test(reqUrl); const isAbsolute = /^https?:\/\//i.test(reqUrl);
console.log('request', req); const fullUrl = isAbsolute ? reqUrl : (vm.$store.state.apiurl + reqUrl);
console.log('baseUrl', vm.$store.state.apiurl); // 用 JSON 字符串输出,避免 HBuilderX 控制台对象被截断、点击 URL 跳浏览器
console.log('完整URL', isAbsolute ? reqUrl : (vm.$store.state.apiurl + reqUrl)); console.log('request => ' + JSON.stringify({
url: fullUrl,
method: req.method,
data: req.data,
header: req.header
}, null, 2));
if (!req.header){ if (!req.header){
req.header = []; req.header = [];
} }

View File

@ -239,8 +239,8 @@ export function buildScanUpdateParams({ id, scanCode, arrangeType, warehouseBinI
if (warehouseBinId) { if (warehouseBinId) {
params.warehouse_bin_id = Number(warehouseBinId); params.warehouse_bin_id = Number(warehouseBinId);
} }
// 长码走二维码,短码走条码 // 长度大于25走二维码否则走条码
if (code.length > 20) { if (code.length > 25) {
params.qr_code = code; params.qr_code = code;
} else { } else {
params.bar_code = code; params.bar_code = code;

View File

@ -250,8 +250,8 @@ export function buildScanUpdateParams({ id, scanCode, arrangeType, warehouseBinI
if (warehouseBinId) { if (warehouseBinId) {
params.warehouse_bin_id = Number(warehouseBinId); params.warehouse_bin_id = Number(warehouseBinId);
} }
// 长码走二维码,短码走条码 // 长度大于25走二维码否则走条码
if (code.length > 20) { if (code.length > 25) {
params.qr_code = code; params.qr_code = code;
} else { } else {
params.bar_code = code; params.bar_code = code;