diff --git a/src/views/GrowUp/MyAlbum.vue b/src/views/GrowUp/MyAlbum.vue index 7cdf9d3..4cb2275 100644 --- a/src/views/GrowUp/MyAlbum.vue +++ b/src/views/GrowUp/MyAlbum.vue @@ -18,24 +18,6 @@ - @@ -221,68 +203,6 @@ export default { this.getUserAlbum() this.getUserSpaceSize() }, - // 读取到文件后 - afterRead(file) { - if (Array.isArray(file)) { - this.fileUpload(file, 0) - } else { - this.fileUpload([file], 0) - } - }, - // 上传照片到文件服务器 - fileUpload(files, index) { - this.$toast.loading({ - message: `上传中 ${index + 1}/${files.length}...`, - duration: 0, - forbidClick: true, - }) - let size = files[index].file.size - let params = new FormData() - params.append('file', files[index].file, files[index].file.name) - let config = { - headers: { - //添加请求头 - 'Content-Type': 'multipart/form-data', - }, - } - Axios.post('https://market.myjxt.com:51311/file/fileUpload', params, config).then((res) => { - this.$toast.clear() - if (res?.status == 200) { - this.uploadImgList.push({ path: res.data, imgSize: size }) - } else { - this.$toast(`照片${index + 1}上传失败,自动忽略`) - } - if (index + 1 < files.length) { - this.fileUpload(files, index + 1) - } else { - // 照片全部上传完成,统一上传到服务器 - this.uploadUserAlbum() - } - }) - }, - // 上传照片 - uploadUserAlbum() { - this.$toast.loading({ - message: `同步照片到我的相册...`, - duration: 0, - forbidClick: true, - }) - this.http - .uploadUserAlbum({ - centerNo: this.userInfo.centerNo, - imgList: this.uploadImgList, - }) - .then((res) => { - this.$toast.clear() - if (res.code == 200) { - this.$toast('同步完成') - this.uploadImgList = [] - this.pageReload() //上传完成后页面重新加载 - } else { - this.$toast(res.message) - } - }) - }, }, } -- libgit2 0.21.0