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

1

parent d1ec5a21
...@@ -1317,8 +1317,16 @@ ...@@ -1317,8 +1317,16 @@
(res) => { (res) => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
if (res.data.data) { if (res.data.data) {
this.currentNode.src = this.domainManager().mallUrl + res.data.data; console.log(this.domainManager().mallUrl,res.data.data)
this.$forceUpdate() 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 { } else {
this.Error(res.data.message); this.Error(res.data.message);
......
...@@ -594,6 +594,21 @@ export default { ...@@ -594,6 +594,21 @@ export default {
}); });
return getBlob 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文件上传 //Blob文件上传
Vue.prototype.uploadSelfBlob = function (path, files, successCall) { Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this; 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