目录

vue-根据后端数据显示图片_vue-后端直接返回图片流,前端怎么直接显示在页面上...

目录

vue 根据后端数据显示图片_vue 后端直接返回图片流,前端怎么直接显示在页面上…

我网上搜了一下,说window.URL.createObjectURL(res)可以但是没有效果fetchData() {

const id = this.$route.query.companyId

getCusInfo(id).then(res => {

const _data = res.data

this.detail = _data

getFileDetail(_data.adAvatar).then(res => {

// const blob = new Blob([res.data], { type: ‘image/png’ })

// const url = window.URL.createObjectURL(blob)

// this.brandLogoUrl = url

const src = window.URL.createObjectURL(res)

this.brandLogoUrl = src

console.log(‘res’, res)

})

console.log(‘brandLogoUrl’, this.brandLogoUrl)

})

},

class=“avatar-uploader”

action="#"

:http-request=“advertiserUpload2”

:show-file-list=“false”

我暂时是这么处理的