图片上传

qianlishi 3 years ago
parent fcb982488e
commit 5c4173b859

@ -127,7 +127,7 @@ export default {
}, },
queryData() { queryData() {
axios({ axios({
url: process.env.VUE_APP_BASE_API + this.url, url: process.env.BASE_API + this.url,
methods: "get", methods: "get",
headers: { headers: {
Authorization: getToken(), Authorization: getToken(),

@ -31,6 +31,7 @@
icon-class="Excel" icon-class="Excel"
class="iconFont" class="iconFont"
/> />
<span class="el-upload-list__item-actions"> <span class="el-upload-list__item-actions">
<span <span
v-if="typeImgShow(file)" v-if="typeImgShow(file)"
@ -102,9 +103,9 @@ export default {
computed: { computed: {
requestUrl() { requestUrl() {
if (this.upLoadUrl != null && this.upLoadUrl.trim() != "") { if (this.upLoadUrl != null && this.upLoadUrl.trim() != "") {
return process.env.VUE_APP_BASE_API + this.upLoadUrl; return process.env.BASE_API + this.upLoadUrl;
} else { } else {
return process.env.VUE_APP_BASE_API + "/meta/file/upload"; return process.env.BASE_API + "/file/upload";
} }
}, },
headers() { headers() {
@ -113,15 +114,9 @@ export default {
}; };
} }
}, },
watch: { mounted() {
value: { this.echoUpload(this.value);
handler(val) {
this.echoUpload(val);
},
immediate: true
}
}, },
mounted() {},
methods: { methods: {
// //
typeImgShow(file) { typeImgShow(file) {
@ -175,7 +170,6 @@ export default {
}, },
// //
handleSuccess(response, file, fileList) { handleSuccess(response, file, fileList) {
console.log(fileList);
if (response.code != 200) { if (response.code != 200) {
this.$message.error("上传失败"); this.$message.error("上传失败");
return; return;
@ -185,6 +179,7 @@ export default {
fileId: file.response.data.fileId, fileId: file.response.data.fileId,
fileType: file.response.data.fileType fileType: file.response.data.fileType
}); });
console.log(this.fileList);
this.change(); this.change();
}, },
// //
@ -248,7 +243,7 @@ export default {
width: 60px; width: 60px;
height: 60px; height: 60px;
} }
.hide_box .el-upload--picture-card { .hide_box /deep/.el-upload--picture-card {
display: none; display: none;
} }
.el-upload-list__item { .el-upload-list__item {

Loading…
Cancel
Save