| | |
| | | } from '../../api/blogArticleType.js' |
| | | |
| | | import myConstant from "../../config/myConstant.js" |
| | | import md5 from 'js-md5'; |
| | | |
| | | export default { |
| | | beforeMount() { |
| | |
| | | ], |
| | | secret: [{ |
| | | required: true, |
| | | message: '不正经的人..', |
| | | message: '好像这里错了..', |
| | | trigger: 'blur' |
| | | }], |
| | | common: [{ |
| | |
| | | }, |
| | | beforeUploadCover(file, fileList) { |
| | | return new Promise((resolve, reject) => { |
| | | if (this.form.secret == null || this.form.secret == "") { |
| | | this.$message.error('需要正确的授权码'); |
| | | return reject(false); |
| | | } |
| | | |
| | | if (this.form.coverFileList.length >= 1) { |
| | | this.$message.error('这里最多上传一个文件'); |
| | | return reject(false); |
| | |
| | | }, |
| | | beforeUpload(file, fileList) { |
| | | return new Promise((resolve, reject) => { |
| | | if (this.form.secret == null || this.form.secret == "") { |
| | | this.$message.error('需要正确的口令..'); |
| | | return reject(false); |
| | | } |
| | | |
| | | if (this.form.blogFileList.length >= 1) { |
| | | this.$message.error('这里最多上传一个文件'); |
| | | return reject(false); |
| | |
| | | const formData = new FormData() |
| | | formData.append('file', option.file) |
| | | formData.append('fileType', option.data.fileType) |
| | | formData.append('authCode', this.form.secret) |
| | | formData.append('authCode', this.form.secret == "" ? "" : md5(this.form.secret)) |
| | | myFileInfoUpload(formData).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success('上传成功') |