uniapp 图片Url转Base64

 

 

urlTobase64(url) {
    uni.request({
        url: url,
        method: 'GET',
        responseType: 'arraybuffer',
        success: async res => {
            let base64 = wx.arrayBufferToBase64(res.data); 
            let Base64Url = 'data:image/jpeg;base64,' + base64;
        }
    });
}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

posted @ 2021-10-30 15:55  _粥  阅读(516)  评论(0编辑  收藏  举报