Commit f026b70c by Cat

zd 社团

parent 93120dba
......@@ -206,7 +206,7 @@ export default {
data() {
return {
//图片上传列表
uploadList: [],
uploadList: {},
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
pev: process.env.VUE_APP_BASE_API,
// 输入框字数限制
......@@ -388,7 +388,6 @@ export default {
this.uploadList = [];
this.check = false;
this.reset();
console.log("form.file", this.form.file);
this.open = true;
this.title = "新增社团风采";
},
......@@ -458,24 +457,24 @@ export default {
this.imageUrl = "";
},
// 上传图片
uploadImage(file) {
const fileData = file.file;
const formData = new FormData();
formData.append("file", fileData);
this.uploadLoading = true;
commonUpload(formData)
.then((response) => {
this.uploadLoading = false;
this.$modal.msgSuccess("上传成功");
this.imageUrl = this.pev + response.url;
// this.form.picUrl = process.env.VUE_APP_BASE_API + response.url
this.form.file = this.pev + response.url;
this.form.picUrl = response.url;
})
.catch((error) => {
this.uploadLoading = false;
});
},
// uploadImage(file) {
// const fileData = file.file;
// const formData = new FormData();
// formData.append("file", fileData);
// this.uploadLoading = true;
// commonUpload(formData)
// .then((response) => {
// this.uploadLoading = false;
// this.$modal.msgSuccess("上传成功");
// this.imageUrl = this.pev + response.url;
// // this.form.picUrl = process.env.VUE_APP_BASE_API + response.url
// this.form.file = this.pev + response.url;
// this.form.picUrl = response.url;
// })
// .catch((error) => {
// this.uploadLoading = false;
// });
// },
/** 提交按钮 */
submitForm() {
......@@ -486,10 +485,9 @@ export default {
const params = {
id: this.form.id,
theme: this.form.theme,
// file: this.form.file,
file: this.uploadList.toString(),
};
console.log(params, "params");
console.log(params, "修改params");
editCommunityInfo(params)
.then((response) => {
this.getList();
......@@ -504,13 +502,14 @@ export default {
theme: this.form.theme,
file: this.uploadList.toString(),
};
console.log(params, "params");
console.log(params, "新增params");
addCommunityInfo(params)
.then((response) => {
this.getList();
this.$message.success("新增成功");
this.open = false;
})
.catch((err) => {});
}
}
......
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