Commit f026b70c by Cat

zd 社团

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