// 确保数据是字符串
const html = typeof res.data === 'string' ? res.data : new TextDecoder('utf-8').decode(new Uint8Array(res.data));
const regex = /<img\s+src="([^"]+)"\s+data-pic="[^"]*"[^>]*\s+alt="([^"]*)"[^>]*>/g;
let match;
let detailImgUrl = '';
let altText = '';
正则表达式收集的中文会出现方框乱码,我是第一次碰到这个问题!!!uft8我也设置了 但是就是不行!!!
