Commit 963fd314 authored by 罗超's avatar 罗超

1

parent d1ec5a21
......@@ -1317,8 +1317,16 @@
(res) => {
if (res.data.resultCode == 1) {
if (res.data.data) {
this.currentNode.src = this.domainManager().mallUrl + res.data.data;
this.$forceUpdate()
console.log(this.domainManager().mallUrl,res.data.data)
let getBlob = this.getAnyFileBlob(this.domainManager().mallUrl + res.data.data)
let that = this
getBlob.then(blob => {
that.blobToDataURL(blob, function (e) {
that.currentNode.src = e;
that.$forceUpdate()
})
});
}
} else {
this.Error(res.data.message);
......
......@@ -594,6 +594,21 @@ export default {
});
return getBlob
},
Vue.prototype.getAnyFileBlob = function (url) {
let getBlob = new Promise(resolve => {
const xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'blob';
xhr.onload = () => {
if (xhr.status === 200) {
resolve(xhr.response);
}
};
xhr.send();
});
return getBlob
},
//Blob文件上传
Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment