inleft
2022-08-12 0dd41bd8cee430d3a948b89c664cb511c400993c
src/components/mini/box10-add.vue
@@ -187,6 +187,7 @@
   } from '../../api/blogArticleType.js'
   import myConstant from "../../config/myConstant.js"
   import md5 from 'js-md5';
   export default {
      beforeMount() {
@@ -259,7 +260,7 @@
               ],
               secret: [{
                  required: true,
                  message: '不正经的人..',
                  message: '好像这里错了..',
                  trigger: 'blur'
               }],
               common: [{
@@ -293,6 +294,11 @@
         },
         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);
@@ -306,6 +312,11 @@
         },
         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);
@@ -360,7 +371,7 @@
            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('上传成功')