js中使用Buffer.from()不会报错
ts中使用Buffer.from(),运行后控制台会报错Buffer undefined
解决方案:用window.atob()解码,然后用Uint8Array存bytes
const { data } = res;
let bytes = window.atob(data.body);
let n = bytes.length;
let ia = new Uint8Array(n);
while (n--) {
ia[n] = bytes.charCodeAt(n);
}