Explorar el Código

上传接口重新修改,并添加token验证

hzj18279462576@163.com hace 7 meses
padre
commit
5bd1702181

+ 5 - 0
npm-shrinkwrap.json

@@ -8593,6 +8593,11 @@
 				}
 			}
 		},
+		"js-cookie": {
+			"version": "3.0.5",
+			"resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-3.0.5.tgz",
+			"integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw=="
+		},
 		"js-tokens": {
 			"version": "3.0.2",
 			"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",

+ 1 - 0
package.json

@@ -28,6 +28,7 @@
     "gulp-replace": "0.6.1",
     "gulp-shell": "0.6.5",
     "image-conversion": "^2.1.1",
+    "js-cookie": "^3.0.5",
     "lodash": "4.17.5",
     "npm": "^6.9.0",
     "sass-loader": "6.0.6",

+ 4 - 2
src/main.js

@@ -32,8 +32,10 @@ Vue.use(Viewer, {
   }
 });
 // Vue.prototype.Tupiantou ='https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload'//线上
-// Vue.prototype.Tupiantou ='http://192.168.161.190:8171/sqx_fast/alioss/upload'//线上
-Vue.prototype.Tupiantou ="https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast/alioss/upload"; //线下
+// Vue.prototype.Tupiantou ='http://192.168.161.190:8171/sqx_fast/admin/new-file/upload'//线上
+// Vue.prototype.Tupiantou ="https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast/alioss/upload"; //线下
+// Vue.prototype.Tupiantou ='https://mxys.chuanghai-tech.com/sqx_fast/admin/new-file/upload'//线上
+Vue.prototype.Tupiantou ="https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast/admin/new-file/upload"; //线下
 Vue.prototype.Tupian = function(img) {
   return "https://mxys.chuanghai-tech.com/wmfile" + img;
   // return "http://192.168.161.190:8171/wmfile" + img;

+ 1 - 1
src/utils/httpRequest.js

@@ -46,7 +46,7 @@ http.interceptors.response.use(
     }
     // console.log(
     //   decrypt(
-    //     urlSafeBase64Decode("nhUrbnqOHepMHbB7tPBn_oOaLdbWPDlhp_SyK75Q_F8Mr_Px-jDaRuofsndXokxjArrhMVMsW7ZftyVcoahqTn25Q0uH-URoPr2F_xucqb_XK8mVoeMXkiJRaBqj8pnw")
+    //     urlSafeBase64Decode("CJd_exM-7HE6UXeV5Ai_gzavMNsUHJLlvQKWNYgNFszSC-Ahieu4OCoM2bqcGCUM")
     //   ),
     //   "11111111111111111111111111"
     // );

+ 5 - 0
src/views/allocation/allocationList.vue

@@ -465,6 +465,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="form.value"
@@ -496,6 +497,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="form.value"
@@ -530,6 +532,7 @@
 </template>
 
 <script>
+import Vue from "vue";
 import { quillEditor } from "vue-quill-editor";
 import "quill/dist/quill.core.css";
 import "quill/dist/quill.snow.css";
@@ -542,6 +545,7 @@ export default {
   },
   data() {
     return {
+      token:"",
       openValue: "是",
       closeValue: "否",
       limit: 10,
@@ -758,6 +762,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
   }
 };

+ 98 - 96
src/views/allocation/quill-config.js

@@ -1,96 +1,98 @@
-/*富文本编辑图片上传配置*/
-const uploadConfig = {
-    action:  'https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload',  // 必填参数 图片上传地址
-    methods: 'POST',  // 必填参数 图片上传方式
-    token: '',  // 可选参数 如果需要token验证,假设你的token有存放在sessionStorage
-    name: 'file',  // 必填参数 文件的参数名
-    size: 500,  // 可选参数   图片大小,单位为Kb, 1M = 1024Kb
-    accept: 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'  // 可选 可上传的图片格式
-};
-
-// toolbar工具栏的工具选项(默认展示全部)
-const toolOptions = [
-    ['bold', 'italic', 'underline', 'strike'],
-    ['blockquote', 'code-block'],
-    [{'header': 1}, {'header': 2}],
-    [{'list': 'ordered'}, {'list': 'bullet'}],
-    [{'script': 'sub'}, {'script': 'super'}],
-    [{'indent': '-1'}, {'indent': '+1'}],
-    [{'direction': 'rtl'}],
-    [{'size': ['small', false, 'large', 'huge']}],
-    [{'header': [1, 2, 3, 4, 5, 6, false]}],
-    [{'color': []}, {'background': []}],
-    [{'font': []}],
-    [{'align': []}],
-    ['clean'],
-    ['link', 'image', 'video']
-];
-const handlers = {
-    image: function image() {
-        var self = this;
-
-        var fileInput = this.container.querySelector('input.ql-image[type=file]');
-        if (fileInput === null) {
-            fileInput = document.createElement('input');
-            fileInput.setAttribute('type', 'file');
-            // 设置图片参数名
-            if (uploadConfig.name) {
-                fileInput.setAttribute('name', uploadConfig.name);
-            }
-            // 可设置上传图片的格式
-            fileInput.setAttribute('accept', uploadConfig.accept);
-            fileInput.classList.add('ql-image');
-            // 监听选择文件
-            fileInput.addEventListener('change', function () {
-                // 创建formData
-                var formData = new FormData();
-                formData.append(uploadConfig.name, fileInput.files[0]);
-                formData.append('object','product');
-                // 如果需要token且存在token
-                if (uploadConfig.token) {
-                    formData.append('token', uploadConfig.token)
-                }
-                // 图片上传
-                var xhr = new XMLHttpRequest();
-                xhr.open(uploadConfig.methods, uploadConfig.action, true);
-                // 上传数据成功,会触发
-                xhr.onload = function (e) {
-                    if (xhr.status === 200) {
-                        var res = JSON.parse(xhr.responseText);
-                        let length = self.quill.getSelection(true).index;
-                        //这里很重要,你图片上传成功后,img的src需要在这里添加,res.path就是你服务器返回的图片链接。
-                        self.quill.insertEmbed(length, 'image', res.data);
-                        self.quill.setSelection(length + 1)
-                    }
-                    fileInput.value = ''
-                    console.log('eeeeeeeeeeeeeeeee',e)
-                };
-                // 开始上传数据
-                xhr.upload.onloadstart = function (e) {
-                    fileInput.value = ''
-                };
-                // 当发生网络异常的时候会触发,如果上传数据的过程还未结束
-                xhr.upload.onerror = function (e) {
-                };
-                // 上传数据完成(成功或者失败)时会触发
-                xhr.upload.onloadend = function (e) {
-                    // console.log('上传结束')
-                };
-                xhr.send(formData)
-            });
-            this.container.appendChild(fileInput);
-        }
-        fileInput.click();
-    }
-};
-
-export default {
-    placeholder: '',
-    theme: 'snow',  // 主题
-    modules: {
-        toolbar: {
-            container: toolOptions,  // 工具栏选项
-            handlers: handlers  // 事件重写
-        }
-    }
-};
+import Vue from "vue";
+import Cookies from 'js-cookie'
+/*富文本编辑图片上传配置*/
+const uploadConfig = {
+    action:  Vue.prototype.Tupiantou,  // 必填参数 图片上传地址
+    methods: 'POST',  // 必填参数 图片上传方式
+    token:  Cookies.get('token'),  // 可选参数 如果需要token验证,假设你的token有存放在sessionStorage
+    name: 'file',  // 必填参数 文件的参数名
+    size: 500,  // 可选参数   图片大小,单位为Kb, 1M = 1024Kb
+    accept: 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'  // 可选 可上传的图片格式
+};
+
+// toolbar工具栏的工具选项(默认展示全部)
+const toolOptions = [
+    ['bold', 'italic', 'underline', 'strike'],
+    ['blockquote', 'code-block'],
+    [{'header': 1}, {'header': 2}],
+    [{'list': 'ordered'}, {'list': 'bullet'}],
+    [{'script': 'sub'}, {'script': 'super'}],
+    [{'indent': '-1'}, {'indent': '+1'}],
+    [{'direction': 'rtl'}],
+    [{'size': ['small', false, 'large', 'huge']}],
+    [{'header': [1, 2, 3, 4, 5, 6, false]}],
+    [{'color': []}, {'background': []}],
+    [{'font': []}],
+    [{'align': []}],
+    ['clean'],
+    ['link', 'image', 'video']
+];
+const handlers = {
+    image: function image() {
+        var self = this;
+
+        var fileInput = this.container.querySelector('input.ql-image[type=file]');
+        if (fileInput === null) {
+            fileInput = document.createElement('input');
+            fileInput.setAttribute('type', 'file');
+            // 设置图片参数名
+            if (uploadConfig.name) {
+                fileInput.setAttribute('name', uploadConfig.name);
+            }
+            // 可设置上传图片的格式
+            fileInput.setAttribute('accept', uploadConfig.accept);
+            fileInput.classList.add('ql-image');
+            // 监听选择文件
+            fileInput.addEventListener('change', function () {
+                // 创建formData
+                var formData = new FormData();
+                formData.append(uploadConfig.name, fileInput.files[0]);
+                formData.append('object','product');
+                // 如果需要token且存在token
+                if (uploadConfig.token) {
+                    formData.append('token', uploadConfig.token)
+                }
+                // 图片上传
+                var xhr = new XMLHttpRequest();
+                xhr.open(uploadConfig.methods, uploadConfig.action, true);
+                // 上传数据成功,会触发
+                xhr.onload = function (e) {
+                    if (xhr.status === 200) {
+                        var res = JSON.parse(xhr.responseText);
+                        let length = self.quill.getSelection(true).index;
+                        //这里很重要,你图片上传成功后,img的src需要在这里添加,res.path就是你服务器返回的图片链接。
+                        self.quill.insertEmbed(length, 'image', res.data);
+                        self.quill.setSelection(length + 1)
+                    }
+                    fileInput.value = ''
+                    console.log('eeeeeeeeeeeeeeeee',e)
+                };
+                // 开始上传数据
+                xhr.upload.onloadstart = function (e) {
+                    fileInput.value = ''
+                };
+                // 当发生网络异常的时候会触发,如果上传数据的过程还未结束
+                xhr.upload.onerror = function (e) {
+                };
+                // 上传数据完成(成功或者失败)时会触发
+                xhr.upload.onloadend = function (e) {
+                    // console.log('上传结束')
+                };
+                xhr.send(formData)
+            });
+            this.container.appendChild(fileInput);
+        }
+        fileInput.click();
+    }
+};
+
+export default {
+    placeholder: '',
+    theme: 'snow',  // 主题
+    modules: {
+        toolbar: {
+            container: toolOptions,  // 工具栏选项
+            handlers: handlers  // 事件重写
+        }
+    }
+};

+ 57 - 36
src/views/autonym/autonym.vue

@@ -374,6 +374,7 @@
               :on-change="handleChange"
               :on-remove="handleRemove"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <!-- :auto-upload="false" -->
               <i class="el-icon-plus"></i>
@@ -395,6 +396,7 @@
               :on-change="handleChange2"
               :on-remove="handleRemove2"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <i class="el-icon-plus"></i>
             </el-upload>
@@ -416,6 +418,7 @@
               :on-remove="handleRemove3"
               :before-upload="beforeAvatarUpload"
               class="cardphoto"
+              :headers="{ token: token }"
             >
               <i class="el-icon-plus"></i>
             </el-upload>
@@ -446,16 +449,28 @@
         class="demo-ruleForm"
       >
         <el-form-item label="银行卡号" prop="cardNumber">
-          <el-input style="width: 250px;" v-model="infoRuleForm.cardNumber"></el-input>
+          <el-input
+            style="width: 250px;"
+            v-model="infoRuleForm.cardNumber"
+          ></el-input>
         </el-form-item>
         <el-form-item label="开户行" prop="bank">
-          <el-input style="width: 250px;" v-model="infoRuleForm.bank"></el-input>
+          <el-input
+            style="width: 250px;"
+            v-model="infoRuleForm.bank"
+          ></el-input>
         </el-form-item>
         <el-form-item label="开户人姓名" prop="name">
-          <el-input style="width: 250px;" v-model="infoRuleForm.name"></el-input>
+          <el-input
+            style="width: 250px;"
+            v-model="infoRuleForm.name"
+          ></el-input>
         </el-form-item>
         <el-form-item label="开户人商户号" prop="mchId">
-          <el-input style="width: 250px;" v-model="infoRuleForm.mchId"></el-input>
+          <el-input
+            style="width: 250px;"
+            v-model="infoRuleForm.mchId"
+          ></el-input>
         </el-form-item>
         <el-form-item>
           <el-button type="primary" @click="submitInfo('infoRuleForm')"
@@ -469,6 +484,7 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
@@ -556,21 +572,25 @@ export default {
         // ]
       },
 
-      infoVisible:false,// 提现信息
+      infoVisible: false, // 提现信息
       infoRuleForm: {
-        userId:"",
-        id:'',
+        userId: "",
+        id: "",
         cardNumber: "",
         bank: "",
         name: "",
-        mchId:"",
+        mchId: ""
       },
       infoRules: {
-        cardNumber: [{ required: true, message: "银行卡号不能为空", trigger: "blur" }],
+        cardNumber: [
+          { required: true, message: "银行卡号不能为空", trigger: "blur" }
+        ],
         bank: [{ required: true, message: "开户行不能为空", trigger: "blur" }],
-        name: [{ required: true, message: "开户人姓名不能为空", trigger: "blur" }],
+        name: [
+          { required: true, message: "开户人姓名不能为空", trigger: "blur" }
+        ]
         // mchId: [{ required: true, message: "开户人商户号不能为空", trigger: "blur" }],
-      },
+      }
     };
   },
   methods: {
@@ -873,13 +893,13 @@ export default {
     },
 
     // 提现信息
-    infoClicks(rows){
-      this.infoVisible=true
+    infoClicks(rows) {
+      this.infoVisible = true;
       this.infoRuleForm.cardNumber = "";
       this.infoRuleForm.bank = "";
       this.infoRuleForm.name = "";
       this.infoRuleForm.id = "";
-      this.infoRuleForm.userId = rows.userId
+      this.infoRuleForm.userId = rows.userId;
       this.$http({
         url: this.$http.adornUrl("rider/bank/getUserId"),
         method: "get",
@@ -888,31 +908,31 @@ export default {
         })
       }).then(({ data }) => {
         console.log(data, "提现信息");
-        if(data.data){
-          this.infoRuleForm.cardNumber = data.data.cardNo
-          this.infoRuleForm.bank = data.data.bankName
-          this.infoRuleForm.name = data.data.realName
-          this.infoRuleForm.mchId = data.data.mchId
-          this.infoRuleForm.id = data.data.id
+        if (data.data) {
+          this.infoRuleForm.cardNumber = data.data.cardNo;
+          this.infoRuleForm.bank = data.data.bankName;
+          this.infoRuleForm.name = data.data.realName;
+          this.infoRuleForm.mchId = data.data.mchId;
+          this.infoRuleForm.id = data.data.id;
         }
       });
-      this.$nextTick(()=>{
+      this.$nextTick(() => {
         this.$refs.infoRuleForm.resetFields();
-      })
+      });
     },
     submitInfo(formName) {
       this.$refs[formName].validate(valid => {
         if (valid) {
-          let agData={
-              "userId": this.infoRuleForm.userId, //骑手id
-              "cardNo": this.infoRuleForm.cardNumber, //卡号
-              "openBank": this.infoRuleForm.bank, //开户行
-              "realName": this.infoRuleForm.name, //户主名称
-              "bankName": this.infoRuleForm.bank, //银行名称
-              "mchId": this.infoRuleForm.mchId //银行名称
-          }
-          if(this.infoRuleForm.id){
-            agData.id=this.infoRuleForm.id
+          let agData = {
+            userId: this.infoRuleForm.userId, //骑手id
+            cardNo: this.infoRuleForm.cardNumber, //卡号
+            openBank: this.infoRuleForm.bank, //开户行
+            realName: this.infoRuleForm.name, //户主名称
+            bankName: this.infoRuleForm.bank, //银行名称
+            mchId: this.infoRuleForm.mchId //银行名称
+          };
+          if (this.infoRuleForm.id) {
+            agData.id = this.infoRuleForm.id;
           }
           this.$http({
             url: this.$http.adornUrl("rider/bank/update"),
@@ -929,7 +949,7 @@ export default {
                   this.dataSelect();
                 }
               });
-              this.infoVisible=false
+              this.infoVisible = false;
             } else {
               this.$message({
                 message: data.msg,
@@ -949,10 +969,11 @@ export default {
       this.infoRuleForm.cardNumber = "";
       this.infoRuleForm.bank = "";
       this.infoRuleForm.name = "";
-      this.infoVisible=false
-    },
+      this.infoVisible = false;
+    }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
     this.stationList();
   }
@@ -982,7 +1003,7 @@ export default {
   width: 500px;
 }
 
-.viewer-container{
+.viewer-container {
   z-index: 999999;
 }
 </style>

+ 9 - 1
src/views/banner/bannerList.vue

@@ -247,6 +247,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="imageUrl"
@@ -367,6 +368,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="imageUrl"
@@ -502,6 +504,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess2"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="form.imageUrl"
@@ -548,10 +551,11 @@
           <el-upload
             class="avatar-uploader"
             v-model="imageUrl"
-            action="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload"
+            :action="Tupiantou"
             :show-file-list="false"
             :on-success="handleAvatarSuccess"
             :before-upload="beforeAvatarUpload"
+            :headers="{ token: token }"
           >
             <img
               v-if="imageUrl"
@@ -602,9 +606,12 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
+
   data() {
     return {
+      token: "",
       page: 1,
       limit: 10,
       classify: 1,
@@ -1430,6 +1437,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
   }
 };

+ 22 - 17
src/views/coupon/coupon copy.vue

@@ -73,11 +73,7 @@
           </el-table-column>
           <el-table-column prop="state" label="查看小程序码">
             <template slot-scope="scope">
-              <el-popover
-                placement="top"
-                width="200"
-                v-if="scope.row.state == 1"
-              >
+              <el-popover placement="top" width="200" v-if="scope.row.state == 1">
                 <div style="width: 180px; height: 180px;">
                   <img style="width: 180px;" :src="couponImg" alt="" />
                 </div>
@@ -201,7 +197,10 @@
 					</el-table-column> -->
           <el-table-column prop="state" label="查看小程序码">
             <template slot-scope="scope">
-              <el-popover placement="top" width="200">
+              <el-popover
+                placement="top"
+                width="200"
+              >
                 <div style="width: 180px; height: 180px;">
                   <img style="width: 180px;" :src="couponImg" alt="" />
                 </div>
@@ -356,6 +355,7 @@
                 :show-file-list="false"
                 :on-success="handleAvatarSuccess1"
                 :before-upload="beforeAvatarUpload"
+                :headers="{ token: token }"
               >
                 <img
                   v-if="couponPicture"
@@ -530,6 +530,7 @@
                     :show-file-list="false"
                     :on-success="handleAvatarSuccess2"
                     :before-upload="beforeAvatarUpload"
+                    :headers="{ token: token }"
                   >
                     <img
                       v-if="form.couponPicture"
@@ -904,9 +905,11 @@
   </div>
 </template>
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       userId: "",
       superAdmin: "", // 判断是否为超级管理员 1是超级管理员 0不是超级管理员
       selectState: "",
@@ -983,7 +986,7 @@ export default {
       couponLogPage: 1,
       couponLogTotal: 1,
 
-      couponImg: ""
+      couponImg: "",
     };
   },
   methods: {
@@ -1340,7 +1343,7 @@ export default {
     },
     // 查看小程序码
     async lookCoupon(row) {
-      this.couponImg = "";
+      this.couponImg=""
       let arr = this.$http.adornParams({
         couponId: row.couponId,
         shopId: row.shopId
@@ -1414,15 +1417,15 @@ export default {
         return;
       }
       if (this.shopId == 0) {
-        if (!this.allMerchant && !this.someMerchant) {
-          this.$notify({
-            title: "提示",
-            duration: 1800,
-            message: "商家不能为空",
-            type: "warning"
-          });
-          return;
-        }
+         if (!this.allMerchant && !this.someMerchant) {
+        this.$notify({
+          title: "提示",
+          duration: 1800,
+          message: "商家不能为空",
+          type: "warning"
+        });
+        return;
+      }
       }
 
       if (this.shopId === 0) {
@@ -1835,9 +1838,11 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
   },
   created() {
+
     var userId = this.$cookie.get("userId");
     this.userId = userId;
     this.$http({

+ 5 - 0
src/views/coupon/coupon.vue

@@ -359,6 +359,7 @@
                 :show-file-list="false"
                 :on-success="handleAvatarSuccess1"
                 :before-upload="beforeAvatarUpload"
+                :headers="{ token: token }"
               >
                 <img
                   v-if="couponPicture"
@@ -471,6 +472,7 @@
                     :show-file-list="false"
                     :on-success="handleAvatarSuccess2"
                     :before-upload="beforeAvatarUpload"
+                    :headers="{ token: token }"
                   >
                     <img
                       v-if="form.couponPicture"
@@ -783,9 +785,11 @@
   </div>
 </template>
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token:"",
       userId: "",
       superAdmin: "", // 判断是否为超级管理员 1是超级管理员 0不是超级管理员
       selectState: "",
@@ -1657,6 +1661,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
   },
   created() {

+ 5 - 0
src/views/coupon/couponShop.vue

@@ -111,6 +111,7 @@
             :show-file-list="false"
             :on-success="handleAvatarSuccess1"
             :before-upload="beforeAvatarUpload"
+            :headers="{ token: token }"
           >
             <img
               v-if="couponPicture"
@@ -187,6 +188,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess2"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="form.couponPicture"
@@ -353,9 +355,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       limit: 10,
       page: 1,
       size1: 10,
@@ -742,6 +746,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.shopId = this.$route.query.shopId;
     this.dataSelect();
   }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1523 - 1418
src/views/fitment/fitmentList.vue


+ 5 - 0
src/views/integral/integral.vue

@@ -216,6 +216,7 @@
             :on-success="handleRemove"
             :on-progress="onprogress1"
             :before-upload="beforeAvatarUpload"
+            :headers="{ token: token }"
           >
             <el-progress
               v-if="percentage1 > 0 && percentage1 < 100"
@@ -449,6 +450,7 @@
               :on-success="handleRemove2"
               :on-progress="onprogress1"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <el-progress
                 v-if="percentage1 > 0 && percentage1 < 100"
@@ -811,6 +813,7 @@
 </template>
 
 <script>
+import Vue from "vue";
 import { quillEditor } from "vue-quill-editor";
 import "quill/dist/quill.core.css";
 import "quill/dist/quill.snow.css";
@@ -823,6 +826,7 @@ export default {
   },
   data() {
     return {
+      token: "",
       limit: 10,
       page: 1,
       limit1: 10,
@@ -1659,6 +1663,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
     this.gethuodongList();
   }

+ 5 - 0
src/views/materials/materialsList.vue

@@ -149,6 +149,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="picture"
@@ -214,6 +215,7 @@
                 :show-file-list="false"
                 :on-success="handleAvatarSuccess2"
                 :before-upload="beforeAvatarUpload"
+                :headers="{ token: token }"
               >
                 <img
                   v-if="formwz.picture"
@@ -250,9 +252,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       limit: 5,
       page: 1,
       state: 1,
@@ -588,6 +592,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
   }
 };

+ 4 - 0
src/views/members/vipPrivilege.vue

@@ -67,6 +67,7 @@
             :show-file-list="false"
             :on-success="handleAvatarSuccess"
             :before-upload="beforeAvatarUpload"
+            :headers="{ token: token }"
           >
             <img
               v-if="memberImg"
@@ -108,9 +109,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       page: 1,
       limit: 10,
       tableDataLoading: true,
@@ -278,6 +281,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
   }
 };

+ 6 - 0
src/views/mission/system.vue

@@ -572,6 +572,7 @@
 							:show-file-list="false"
 							:on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
 							>
 							<img v-if="item.picture" :src="item.picture" class="avatar" style="width: 148px;height:137px;"/>
 							<i v-else class="el-icon-plus avatar-uploader-icon" @click="curRowIndex=index"></i>
@@ -657,6 +658,7 @@
 					:show-file-list="false"
 					:on-success="handleAvatarSuccess1"
           :before-upload="beforeAvatarUpload"
+          :headers="{ token: token }"
 					>
 					<img v-if="imageUrl" :src="imageUrl" class="avatar" style="border-radius: 6px;width: 148px;height: 148px;"/>
 					<i v-else class="el-icon-plus avatar-uploader-icon"></i>
@@ -692,6 +694,7 @@
 		    		:show-file-list="false"
 		    		:on-success="handleAvatarSuccess2"
             :before-upload="beforeAvatarUpload"
+            :headers="{ token: token }"
 		    		>
 		    		<img v-if="form.imageUrl" :src="form.imageUrl" class="avatar" style="border-radius: 6px;width: 148px;height: 148px;"/>
 		    		<i v-else class="el-icon-plus avatar-uploader-icon"></i>
@@ -720,9 +723,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 	export default {
 	    data() {
 	      return {
+      token: "",
 				openValue: '1',
 				closeValue: '0',
 				limit:10,
@@ -1585,6 +1590,7 @@
 			}
 		},
 		mounted() {
+    this.token = Vue.cookie.get("token");
 			this.dataSelect()
 			this.renwuSelect()
 			this.userRwSelect()

+ 5 - 0
src/views/runErrands/bannerList.vue

@@ -383,6 +383,7 @@
             :show-file-list="false"
             :on-success="handleAvatarSuccess"
             :before-upload="beforeAvatarUpload"
+            :headers="{ token: token }"
           >
             <img
               v-if="imageUrl"
@@ -443,6 +444,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess2"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="form.imageUrl"
@@ -473,9 +475,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       page: 1,
       limit: 10,
       size: 5,
@@ -1349,6 +1353,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
   }
 };

+ 1 - 0
src/views/runErrands/financeList.vue

@@ -1916,6 +1916,7 @@ export default {
           flag: this.flag1
         })
       }).then(({ data }) => {
+        console.log(data, "充值统计");
         if (data.code == 0) {
           let returnData = data.data;
           this.rechgeData = returnData;

+ 98 - 96
src/views/runErrands/quill-config.js

@@ -1,96 +1,98 @@
-/*富文本编辑图片上传配置*/
-const uploadConfig = {
-    action:  'https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload',  // 必填参数 图片上传地址
-    methods: 'POST',  // 必填参数 图片上传方式
-    token: '',  // 可选参数 如果需要token验证,假设你的token有存放在sessionStorage
-    name: 'file',  // 必填参数 文件的参数名
-    size: 500,  // 可选参数   图片大小,单位为Kb, 1M = 1024Kb
-    accept: 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'  // 可选 可上传的图片格式
-};
-
-// toolbar工具栏的工具选项(默认展示全部)
-const toolOptions = [
-    ['bold', 'italic', 'underline', 'strike'],
-    ['blockquote', 'code-block'],
-    [{'header': 1}, {'header': 2}],
-    [{'list': 'ordered'}, {'list': 'bullet'}],
-    [{'script': 'sub'}, {'script': 'super'}],
-    [{'indent': '-1'}, {'indent': '+1'}],
-    [{'direction': 'rtl'}],
-    [{'size': ['small', false, 'large', 'huge']}],
-    [{'header': [1, 2, 3, 4, 5, 6, false]}],
-    [{'color': []}, {'background': []}],
-    [{'font': []}],
-    [{'align': []}],
-    ['clean'],
-    ['link', 'image', 'video']
-];
-const handlers = {
-    image: function image() {
-        var self = this;
-
-        var fileInput = this.container.querySelector('input.ql-image[type=file]');
-        if (fileInput === null) {
-            fileInput = document.createElement('input');
-            fileInput.setAttribute('type', 'file');
-            // 设置图片参数名
-            if (uploadConfig.name) {
-                fileInput.setAttribute('name', uploadConfig.name);
-            }
-            // 可设置上传图片的格式
-            fileInput.setAttribute('accept', uploadConfig.accept);
-            fileInput.classList.add('ql-image');
-            // 监听选择文件
-            fileInput.addEventListener('change', function () {
-                // 创建formData
-                var formData = new FormData();
-                formData.append(uploadConfig.name, fileInput.files[0]);
-                formData.append('object','product');
-                // 如果需要token且存在token
-                if (uploadConfig.token) {
-                    formData.append('token', uploadConfig.token)
-                }
-                // 图片上传
-                var xhr = new XMLHttpRequest();
-                xhr.open(uploadConfig.methods, uploadConfig.action, true);
-                // 上传数据成功,会触发
-                xhr.onload = function (e) {
-                    if (xhr.status === 200) {
-                        var res = JSON.parse(xhr.responseText);
-                        let length = self.quill.getSelection(true).index;
-                        //这里很重要,你图片上传成功后,img的src需要在这里添加,res.path就是你服务器返回的图片链接。
-                        self.quill.insertEmbed(length, 'image', res.data);
-                        self.quill.setSelection(length + 1)
-                    }
-                    fileInput.value = ''
-                    console.log('eeeeeeeeeeeeeeeee',e)
-                };
-                // 开始上传数据
-                xhr.upload.onloadstart = function (e) {
-                    fileInput.value = ''
-                };
-                // 当发生网络异常的时候会触发,如果上传数据的过程还未结束
-                xhr.upload.onerror = function (e) {
-                };
-                // 上传数据完成(成功或者失败)时会触发
-                xhr.upload.onloadend = function (e) {
-                    // console.log('上传结束')
-                };
-                xhr.send(formData)
-            });
-            this.container.appendChild(fileInput);
-        }
-        fileInput.click();
-    }
-};
-
-export default {
-    placeholder: '',
-    theme: 'snow',  // 主题
-    modules: {
-        toolbar: {
-            container: toolOptions,  // 工具栏选项
-            handlers: handlers  // 事件重写
-        }
-    }
-};
+import Vue from "vue";
+import Cookies from 'js-cookie'
+/*富文本编辑图片上传配置*/
+const uploadConfig = {
+    action:  Vue.prototype.Tupiantou,  // 必填参数 图片上传地址
+    methods: 'POST',  // 必填参数 图片上传方式
+    token: Cookies.get('token'),  // 可选参数 如果需要token验证,假设你的token有存放在sessionStorage
+    name: 'file',  // 必填参数 文件的参数名
+    size: 500,  // 可选参数   图片大小,单位为Kb, 1M = 1024Kb
+    accept: 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'  // 可选 可上传的图片格式
+};
+
+// toolbar工具栏的工具选项(默认展示全部)
+const toolOptions = [
+    ['bold', 'italic', 'underline', 'strike'],
+    ['blockquote', 'code-block'],
+    [{'header': 1}, {'header': 2}],
+    [{'list': 'ordered'}, {'list': 'bullet'}],
+    [{'script': 'sub'}, {'script': 'super'}],
+    [{'indent': '-1'}, {'indent': '+1'}],
+    [{'direction': 'rtl'}],
+    [{'size': ['small', false, 'large', 'huge']}],
+    [{'header': [1, 2, 3, 4, 5, 6, false]}],
+    [{'color': []}, {'background': []}],
+    [{'font': []}],
+    [{'align': []}],
+    ['clean'],
+    ['link', 'image', 'video']
+];
+const handlers = {
+    image: function image() {
+        var self = this;
+
+        var fileInput = this.container.querySelector('input.ql-image[type=file]');
+        if (fileInput === null) {
+            fileInput = document.createElement('input');
+            fileInput.setAttribute('type', 'file');
+            // 设置图片参数名
+            if (uploadConfig.name) {
+                fileInput.setAttribute('name', uploadConfig.name);
+            }
+            // 可设置上传图片的格式
+            fileInput.setAttribute('accept', uploadConfig.accept);
+            fileInput.classList.add('ql-image');
+            // 监听选择文件
+            fileInput.addEventListener('change', function () {
+                // 创建formData
+                var formData = new FormData();
+                formData.append(uploadConfig.name, fileInput.files[0]);
+                formData.append('object','product');
+                // 如果需要token且存在token
+                if (uploadConfig.token) {
+                    formData.append('token', uploadConfig.token)
+                }
+                // 图片上传
+                var xhr = new XMLHttpRequest();
+                xhr.open(uploadConfig.methods, uploadConfig.action, true);
+                // 上传数据成功,会触发
+                xhr.onload = function (e) {
+                    if (xhr.status === 200) {
+                        var res = JSON.parse(xhr.responseText);
+                        let length = self.quill.getSelection(true).index;
+                        //这里很重要,你图片上传成功后,img的src需要在这里添加,res.path就是你服务器返回的图片链接。
+                        self.quill.insertEmbed(length, 'image', res.data);
+                        self.quill.setSelection(length + 1)
+                    }
+                    fileInput.value = ''
+                    console.log('eeeeeeeeeeeeeeeee',e)
+                };
+                // 开始上传数据
+                xhr.upload.onloadstart = function (e) {
+                    fileInput.value = ''
+                };
+                // 当发生网络异常的时候会触发,如果上传数据的过程还未结束
+                xhr.upload.onerror = function (e) {
+                };
+                // 上传数据完成(成功或者失败)时会触发
+                xhr.upload.onloadend = function (e) {
+                    // console.log('上传结束')
+                };
+                xhr.send(formData)
+            });
+            this.container.appendChild(fileInput);
+        }
+        fileInput.click();
+    }
+};
+
+export default {
+    placeholder: '',
+    theme: 'snow',  // 主题
+    modules: {
+        toolbar: {
+            container: toolOptions,  // 工具栏选项
+            handlers: handlers  // 事件重写
+        }
+    }
+};

+ 98 - 96
src/views/selfShop/quill-config.js

@@ -1,96 +1,98 @@
-/*富文本编辑图片上传配置*/
-const uploadConfig = {
-    action:  'https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload',  // 必填参数 图片上传地址
-    methods: 'POST',  // 必填参数 图片上传方式
-    token: '',  // 可选参数 如果需要token验证,假设你的token有存放在sessionStorage
-    name: 'file',  // 必填参数 文件的参数名
-    size: 500,  // 可选参数   图片大小,单位为Kb, 1M = 1024Kb
-    accept: 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'  // 可选 可上传的图片格式
-};
-
-// toolbar工具栏的工具选项(默认展示全部)
-const toolOptions = [
-    ['bold', 'italic', 'underline', 'strike'],
-    ['blockquote', 'code-block'],
-    [{'header': 1}, {'header': 2}],
-    [{'list': 'ordered'}, {'list': 'bullet'}],
-    [{'script': 'sub'}, {'script': 'super'}],
-    [{'indent': '-1'}, {'indent': '+1'}],
-    [{'direction': 'rtl'}],
-    [{'size': ['small', false, 'large', 'huge']}],
-    [{'header': [1, 2, 3, 4, 5, 6, false]}],
-    [{'color': []}, {'background': []}],
-    [{'font': []}],
-    [{'align': []}],
-    ['clean'],
-    ['link', 'image', 'video']
-];
-const handlers = {
-    image: function image() {
-        var self = this;
-
-        var fileInput = this.container.querySelector('input.ql-image[type=file]');
-        if (fileInput === null) {
-            fileInput = document.createElement('input');
-            fileInput.setAttribute('type', 'file');
-            // 设置图片参数名
-            if (uploadConfig.name) {
-                fileInput.setAttribute('name', uploadConfig.name);
-            }
-            // 可设置上传图片的格式
-            fileInput.setAttribute('accept', uploadConfig.accept);
-            fileInput.classList.add('ql-image');
-            // 监听选择文件
-            fileInput.addEventListener('change', function () {
-                // 创建formData
-                var formData = new FormData();
-                formData.append(uploadConfig.name, fileInput.files[0]);
-                formData.append('object','product');
-                // 如果需要token且存在token
-                if (uploadConfig.token) {
-                    formData.append('token', uploadConfig.token)
-                }
-                // 图片上传
-                var xhr = new XMLHttpRequest();
-                xhr.open(uploadConfig.methods, uploadConfig.action, true);
-                // 上传数据成功,会触发
-                xhr.onload = function (e) {
-                    if (xhr.status === 200) {
-                        var res = JSON.parse(xhr.responseText);
-                        let length = self.quill.getSelection(true).index;
-                        //这里很重要,你图片上传成功后,img的src需要在这里添加,res.path就是你服务器返回的图片链接。
-                        self.quill.insertEmbed(length, 'image', res.data);
-                        self.quill.setSelection(length + 1)
-                    }
-                    fileInput.value = ''
-                    console.log('eeeeeeeeeeeeeeeee',e)
-                };
-                // 开始上传数据
-                xhr.upload.onloadstart = function (e) {
-                    fileInput.value = ''
-                };
-                // 当发生网络异常的时候会触发,如果上传数据的过程还未结束
-                xhr.upload.onerror = function (e) {
-                };
-                // 上传数据完成(成功或者失败)时会触发
-                xhr.upload.onloadend = function (e) {
-                    // console.log('上传结束')
-                };
-                xhr.send(formData)
-            });
-            this.container.appendChild(fileInput);
-        }
-        fileInput.click();
-    }
-};
-
-export default {
-    placeholder: '',
-    theme: 'snow',  // 主题
-    modules: {
-        toolbar: {
-            container: toolOptions,  // 工具栏选项
-            handlers: handlers  // 事件重写
-        }
-    }
-};
+import Vue from "vue";
+import Cookies from 'js-cookie'
+/*富文本编辑图片上传配置*/
+const uploadConfig = {
+    action:  Vue.prototype.Tupiantou,  // 必填参数 图片上传地址
+    methods: 'POST',  // 必填参数 图片上传方式
+    token: Cookies.get('token'),  // 可选参数 如果需要token验证,假设你的token有存放在sessionStorage
+    name: 'file',  // 必填参数 文件的参数名
+    size: 500,  // 可选参数   图片大小,单位为Kb, 1M = 1024Kb
+    accept: 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'  // 可选 可上传的图片格式
+};
+
+// toolbar工具栏的工具选项(默认展示全部)
+const toolOptions = [
+    ['bold', 'italic', 'underline', 'strike'],
+    ['blockquote', 'code-block'],
+    [{'header': 1}, {'header': 2}],
+    [{'list': 'ordered'}, {'list': 'bullet'}],
+    [{'script': 'sub'}, {'script': 'super'}],
+    [{'indent': '-1'}, {'indent': '+1'}],
+    [{'direction': 'rtl'}],
+    [{'size': ['small', false, 'large', 'huge']}],
+    [{'header': [1, 2, 3, 4, 5, 6, false]}],
+    [{'color': []}, {'background': []}],
+    [{'font': []}],
+    [{'align': []}],
+    ['clean'],
+    ['link', 'image', 'video']
+];
+const handlers = {
+    image: function image() {
+        var self = this;
+
+        var fileInput = this.container.querySelector('input.ql-image[type=file]');
+        if (fileInput === null) {
+            fileInput = document.createElement('input');
+            fileInput.setAttribute('type', 'file');
+            // 设置图片参数名
+            if (uploadConfig.name) {
+                fileInput.setAttribute('name', uploadConfig.name);
+            }
+            // 可设置上传图片的格式
+            fileInput.setAttribute('accept', uploadConfig.accept);
+            fileInput.classList.add('ql-image');
+            // 监听选择文件
+            fileInput.addEventListener('change', function () {
+                // 创建formData
+                var formData = new FormData();
+                formData.append(uploadConfig.name, fileInput.files[0]);
+                formData.append('object','product');
+                // 如果需要token且存在token
+                if (uploadConfig.token) {
+                    formData.append('token', uploadConfig.token)
+                }
+                // 图片上传
+                var xhr = new XMLHttpRequest();
+                xhr.open(uploadConfig.methods, uploadConfig.action, true);
+                // 上传数据成功,会触发
+                xhr.onload = function (e) {
+                    if (xhr.status === 200) {
+                        var res = JSON.parse(xhr.responseText);
+                        let length = self.quill.getSelection(true).index;
+                        //这里很重要,你图片上传成功后,img的src需要在这里添加,res.path就是你服务器返回的图片链接。
+                        self.quill.insertEmbed(length, 'image', res.data);
+                        self.quill.setSelection(length + 1)
+                    }
+                    fileInput.value = ''
+                    console.log('eeeeeeeeeeeeeeeee',e)
+                };
+                // 开始上传数据
+                xhr.upload.onloadstart = function (e) {
+                    fileInput.value = ''
+                };
+                // 当发生网络异常的时候会触发,如果上传数据的过程还未结束
+                xhr.upload.onerror = function (e) {
+                };
+                // 上传数据完成(成功或者失败)时会触发
+                xhr.upload.onloadend = function (e) {
+                    // console.log('上传结束')
+                };
+                xhr.send(formData)
+            });
+            this.container.appendChild(fileInput);
+        }
+        fileInput.click();
+    }
+};
+
+export default {
+    placeholder: '',
+    theme: 'snow',  // 主题
+    modules: {
+        toolbar: {
+            container: toolOptions,  // 工具栏选项
+            handlers: handlers  // 事件重写
+        }
+    }
+};

+ 6 - 0
src/views/selfShop/shopAmend.vue

@@ -174,6 +174,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess1"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="goodsCover"
@@ -217,6 +218,7 @@
               :on-success="handleUploadSuccess"
               :on-change="handleChange"
               :on-remove="handleRemove"
+              :headers="{ token: token }"
               :before-upload="beforeAvatarUpload"
             >
               <i class="el-icon-plus"></i>
@@ -585,6 +587,7 @@
             :on-success="handleUploadSuccessXq"
             :on-progress="onprogress1"
             :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
           >
             <el-progress
               v-if="percentage1 > 0 && percentage1 < 100"
@@ -621,6 +624,7 @@
 </template>
 
 <script>
+import Vue from "vue";
 import { quillEditor } from "vue-quill-editor";
 import "quill/dist/quill.core.css";
 import "quill/dist/quill.snow.css";
@@ -634,6 +638,7 @@ export default {
   name: "Tinymce",
   data() {
     return {
+      token: "",
       tableDataLoading: true,
       originalPrice: "",
       price: "",
@@ -1506,6 +1511,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.init();
     // this.specifSelect();
     window.scrollTo(0, 0);

+ 13 - 4
src/views/selfShop/shopConfig.vue

@@ -53,9 +53,11 @@
             <el-upload
               class="avatar-uploader"
               v-model="imgUrl"
-              action="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload"
+              :action="Tupiantou"
               :show-file-list="false"
               :on-success="handleAvatarSuccess1"
+              :headers="{ token: token }"
+
             >
               <img
                 v-if="imgUrl"
@@ -92,9 +94,10 @@
               <el-upload
                 class="avatar-uploader"
                 v-model="imgUrl"
-                action="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload"
+                :action="Tupiantou"
                 :show-file-list="false"
                 :on-success="handleAvatarSuccess3"
+                :headers="{ token: token }"
               >
                 <img
                   v-if="form2.imgUrl"
@@ -209,9 +212,10 @@
             <el-upload
               class="avatar-uploader"
               v-model="image_url"
-              action="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload"
+              :action="Tupiantou"
               :show-file-list="false"
               :on-success="handleAvatarSuccess4"
+              :headers="{ token: token }"
             >
               <img
                 v-if="image_url"
@@ -259,9 +263,11 @@
               <el-upload
                 class="avatar-uploader"
                 v-model="image_url"
-                action="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload"
+                :action="Tupiantou"
                 :show-file-list="false"
                 :on-success="handleAvatarSuccess2"
+
+                :headers="{ token: token }"
               >
                 <img
                   v-if="form1.image_url"
@@ -624,9 +630,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token:"",
       size: 10,
       page: 1,
       id: "",
@@ -1327,6 +1335,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.advertSelect();
   }
 };

+ 78 - 57
src/views/selfShop/shopPublish.vue

@@ -227,6 +227,7 @@
               :action="Tupiantou"
               :show-file-list="false"
               :on-success="handleAvatarSuccess1"
+              :headers="{ token: token }"
             >
               <img
                 v-if="goodsCover"
@@ -246,10 +247,10 @@
           style="display: flex;align-items: center;margin: 2% 0;flex-flow: wrap;"
         >
           <span style="display: inline-block;text-align: left;"
-            >商品轮播图:<br>(轮播图最多上传4张)&nbsp;&nbsp;&nbsp;</span
+            >商品轮播图:<br />(轮播图最多上传4张)&nbsp;&nbsp;&nbsp;</span
           >
 
-          <div v-for="(item, index) of potost">
+          <div v-for="(item, index) of potost" :key="index">
             <div style="position: relative;margin: 5px;">
               <img
                 :src="item"
@@ -264,13 +265,14 @@
               </div>
             </div>
           </div>
-          <div class="imgs" style="width: 50%;">
+          <div class="imgs">
             <el-upload
               :action="Tupiantou"
               list-type="picture-card"
               :show-file-list="false"
               :on-success="handleUploadSuccess"
               :on-progress="onprogress1"
+              :headers="{ token: token }"
             >
               <el-progress
                 v-if="percentage1 > 0 && percentage1 < 100"
@@ -286,7 +288,7 @@
           </div>
 
           <!-- <div>
-            <el-upload :action="Tupiantou" list-type="picture-card"
+            <el-upload :action="Tupiantou" :headers="{ token: token }"  list-type="picture-card"
               :on-success="handleUploadSuccess" :on-change="handleChange" :on-remove="handleRemove">
               <i class="el-icon-plus"></i>
             </el-upload>
@@ -309,7 +311,7 @@
             >
               <el-option
                 v-for="(item, index) in specifdata"
-                :key="item.index"
+                :key="index"
                 :label="item.ruleName"
                 :value="item.id"
               >
@@ -503,7 +505,7 @@
                   <div class="imgWrap"
                     style=" width:60px;height:60px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 60px;">
                     <el-upload style="width: 60px;height: 60px;" class="avatar-uploader" v-model="scope.row.skuImg"
-                      :action="Tupiantou" :show-file-list="false"
+                      :action="Tupiantou" :headers="{ token: token }" :show-file-list="false"
                       :on-success="handleAvatarSuccess">
                       <img v-if="scope.row.skuImg" :src="scope.row.skuImg" class="avatar"
                         style="border-radius: 6px;width:60px;height: 60px;" @click="curRowIndex=scope.$index" />
@@ -598,7 +600,7 @@
                   <div class="imgWrap"
                     style=" width:60px;height:60px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 60px;">
                     <el-upload style="width: 60px;height: 60px;" class="avatar-uploader" v-model="scope.row.skuImg"
-                      :action="Tupiantou" :show-file-list="false"
+                      :action="Tupiantou" :headers="{ token: token }" :show-file-list="false"
                       :on-success="handleAvatarSuccess3">
                       <img v-if="scope.row.skuImg" :src="scope.row.skuImg" class="avatar"
                         style="border-radius: 6px;width:60px;height: 60px;" @click="curRowIndex=scope.$index" />
@@ -669,12 +671,14 @@
       </div> -->
       </div>
       <div class="tinymce-content" style="display: flex;">
-        <div style="width:180px;">商品详情(选填):<br>(商品详情图最多上传4张)&nbsp;&nbsp;&nbsp;</div>
+        <div style="width:180px;">
+          商品详情(选填):<br />(商品详情图最多上传4张)&nbsp;&nbsp;&nbsp;
+        </div>
         <!-- <textarea id="tinymceId" :value="goodsDescribe" class="tinymce-textarea" /> -->
         <!-- <quill-editor ref="myTextEditor" v-model="goodsSynopsis" :options="quillOption"
           style="padding-bottom: 50px;height: 300px;width: 72%;display: inline-table;margin-bottom: 60px;">
         </quill-editor> -->
-        <div v-for="(item, index) of goodsParticularsPicture">
+        <div v-for="(item, index) of goodsParticularsPicture" :key="index">
           <div style="position: relative;margin: 5px;">
             <img
               :src="item"
@@ -696,6 +700,7 @@
             :show-file-list="false"
             :on-success="handleUploadSuccessXq"
             :on-progress="onprogress1"
+            :headers="{ token: token }"
           >
             <el-progress
               v-if="percentage1 > 0 && percentage1 < 100"
@@ -739,7 +744,11 @@
     >
       <div>
         <div class="title">
-          <span>封面图:</span><span>共有<span>{{ cover.length }}</span>条结果供选择</span>
+          <span>封面图:</span
+          ><span
+            >共有<span>{{ cover.length }}</span
+            >条结果供选择</span
+          >
         </div>
         <div class="tupian" id="cover" @scroll="searchTupianScroll1">
           <div
@@ -761,7 +770,11 @@
       </div>
       <div>
         <div class="title">
-          <span>轮播图:</span><span>共有<span>{{ carousel.length }}</span>条结果供选择</span>
+          <span>轮播图:</span
+          ><span
+            >共有<span>{{ carousel.length }}</span
+            >条结果供选择</span
+          >
         </div>
         <div class="tupian" id="carousel" @scroll="searchTupianScroll2">
           <div
@@ -783,7 +796,11 @@
       </div>
       <div>
         <div class="title">
-          <span>详情图:</span><span>共有<span>{{ detail.length }}</span>条结果供选择</span>
+          <span>详情图:</span
+          ><span
+            >共有<span>{{ detail.length }}</span
+            >条结果供选择</span
+          >
         </div>
         <div class="tupian" id="detail" @scroll="searchTupianScroll3">
           <div
@@ -817,6 +834,7 @@
 </template>
 
 <script>
+import Vue from "vue";
 import { quillEditor } from "vue-quill-editor";
 import "quill/dist/quill.core.css";
 import "quill/dist/quill.snow.css";
@@ -830,6 +848,7 @@ export default {
   name: "Tinymce",
   data() {
     return {
+      token: "",
       specif: "",
       typeId: "",
       goodsName: "",
@@ -1003,6 +1022,7 @@ export default {
         this.postagePrice = 0;
       }
     },
+
     // 是否多规格
     guigeChange(val) {
       if (val == 1) {
@@ -1062,18 +1082,17 @@ export default {
       console.log("this.potost", this.potost);
     },
     handleAvatarSuccess1(file, fileList) {
-      console.log(file,"封面图上传成功");
+      console.log(file, "封面图上传成功");
       this.goodsCover = file.data;
     },
     //上传成功
     handleUploadSuccess(file, fileList) {
       // this.goodsPicture += file.data + ','
-      console.log(file,"轮播图上传成功");
-      if(this.potost.length>=4){
-        this.potost.shift()
+      console.log(file, "轮播图上传成功");
+      if (this.potost.length >= 4) {
+        this.potost.shift();
       }
       this.potost.unshift(file.data);
-
     },
     // 返回上一级
     prev() {
@@ -1401,7 +1420,7 @@ export default {
           shopId: this.shopId
         })
       }).then(({ data }) => {
-        console.log(data,'商品规格');
+        console.log(data, "商品规格");
 
         let returnData = data.data;
         this.specifdata = returnData;
@@ -1589,8 +1608,8 @@ export default {
     },
     //上传成功
     handleUploadSuccessXq(file, fileList) {
-      if(this.goodsParticularsPicture.length>=4){
-        this.goodsParticularsPicture.shift()
+      if (this.goodsParticularsPicture.length >= 4) {
+        this.goodsParticularsPicture.shift();
       }
       this.goodsParticularsPicture.unshift(file.data);
     },
@@ -1729,24 +1748,24 @@ export default {
     },
     // 通过商品名称获取数据弹出
     searchTupian() {
-      if(!this.goodsName){
+      if (!this.goodsName) {
         this.$notify({
           title: "提示",
           duration: 1800,
           message: "请输入商品标题进行搜索",
           type: "warning"
         });
-        return
+        return;
       }
-      this.cover=[]
-      this.cover1=[]
-      this.carousel=[]
-      this.carousel1=[]
-      this.detail=[]
-      this.detail1=[]
-      this.coverPage=1
-      this.carouselPage=1
-      this.detailPage=1
+      this.cover = [];
+      this.cover1 = [];
+      this.carousel = [];
+      this.carousel1 = [];
+      this.detail = [];
+      this.detail1 = [];
+      this.coverPage = 1;
+      this.carouselPage = 1;
+      this.detailPage = 1;
       this.tupianVisible = true;
       this.searchTupianList1();
       this.searchTupianList2();
@@ -1754,41 +1773,42 @@ export default {
     },
     // 确定图片
     searchAffirm() {
-
-      this.cover1.forEach(i=>{
-        this.goodsCover=i.goodsCover
-      })
-      this.potost=[]
-      for(var a=0;a<this.carousel.length;a++){
-        this.carousel1.forEach(i=>{
-          if(i.id==this.carousel[a].id){
-            this.potost.push(this.carousel[a].goodsPicture)
+      this.cover1.forEach(i => {
+        this.goodsCover = i.goodsCover;
+      });
+      this.potost = [];
+      for (var a = 0; a < this.carousel.length; a++) {
+        this.carousel1.forEach(i => {
+          if (i.id == this.carousel[a].id) {
+            this.potost.push(this.carousel[a].goodsPicture);
           }
-        })
+        });
       }
-      this.goodsParticularsPicture=[]
-      for(var b=0;b<this.detail.length;b++){
-        this.detail1.forEach(i=>{
-          if(i.id==this.detail[b].id){
-            this.goodsParticularsPicture.push(this.detail[b].goodsParticularsPicture)
+      this.goodsParticularsPicture = [];
+      for (var b = 0; b < this.detail.length; b++) {
+        this.detail1.forEach(i => {
+          if (i.id == this.detail[b].id) {
+            this.goodsParticularsPicture.push(
+              this.detail[b].goodsParticularsPicture
+            );
           }
-        })
+        });
       }
       this.tupianVisible = false;
-      console.log(this.potost,'iii')
+      console.log(this.potost, "iii");
     },
     // 取消弹出
     searchCancle() {
       this.tupianVisible = false;
-      this.cover=[]
-      this.cover1=[]
-      this.carousel=[]
-      this.carousel1=[]
-      this.detail=[]
-      this.detail1=[]
-      this.coverPage=1
-      this.carouselPage=1
-      this.detailPage=1
+      this.cover = [];
+      this.cover1 = [];
+      this.carousel = [];
+      this.carousel1 = [];
+      this.detail = [];
+      this.detail1 = [];
+      this.coverPage = 1;
+      this.carouselPage = 1;
+      this.detailPage = 1;
     },
     // 判断是否勾选封面图
     isChecked1(item) {
@@ -1859,6 +1879,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.shopId = this.$route.query.shopId;
     console.log("shopId:", this.shopId);
     // this.init()

+ 4 - 0
src/views/servicePackage/servicePackage.vue

@@ -443,6 +443,7 @@
                   :show-file-list="false"
                   :on-success="handleUploadSuccess"
                   :on-progress="onprogress1"
+                  :headers="{ token: token }"
                 >
                   <el-progress
                     v-if="percentage1 > 0 && percentage1 < 100"
@@ -789,6 +790,7 @@
 </template>
 
 <script>
+import Vue from "vue";
 import { jsonp } from "vue-jsonp";
 import {
   provinceAndCityData,
@@ -804,6 +806,7 @@ var geocoder,
 export default {
   data() {
     return {
+      token: "",
       activeName: "first",
       name: "",
       setType: "",
@@ -1708,6 +1711,7 @@ export default {
     setRuleImp() {}
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
     this.shopList();
   }

+ 7 - 0
src/views/shopAutonym/shopAutonym.vue

@@ -343,6 +343,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess2"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="form.shopCover"
@@ -377,6 +378,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccessZ"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="form.identityCardPro"
@@ -399,6 +401,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccessF"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="form.identityCardCon"
@@ -429,6 +432,7 @@
               :on-success="handleUploadSuccess"
               :on-change="handleChange"
               :on-remove="handleRemove"
+              :headers="{ token: token }"
             >
               <!-- <el-progress
               v-if="percentage1 > 0 && percentage1 < 100"
@@ -473,9 +477,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       limit: 10,
       page: 1,
       content: "",
@@ -865,6 +871,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.dataSelect();
     this.dataSelect1();
   }

+ 4 - 1
src/views/shopManagement/shopsList.vue

@@ -77,7 +77,7 @@
           </span>
         </div>
         <div class="imgs" style="width: 50%;">
-          <el-upload :action="Tupiantou" list-type="picture-card"
+          <el-upload :action="Tupiantou" :headers="{ token: token }" list-type="picture-card"
             :show-file-list="false" :on-success="handleRemove" :on-progress="onprogress1">
             <el-progress v-if="percentage1>0 && percentage1<100" type="circle" :percentage="percentage1"></el-progress>
             <i v-else class="el-icon-plus"></i>
@@ -141,6 +141,7 @@
 </template>
 
 <script>
+import Vue from "vue";
   import {
     jsonp
   } from 'vue-jsonp'
@@ -148,6 +149,7 @@
   export default {
     data() {
       return {
+      token: "",
         limit: 10,
         page: 1,
         shopId: '',
@@ -568,6 +570,7 @@
       }
     },
     mounted() {
+    this.token = Vue.cookie.get("token");
       this.dataSelect()
 
     },

+ 4 - 0
src/views/shopsList/shopWallet.vue

@@ -178,6 +178,7 @@
               :action="Tupiantou"
               :show-file-list="false"
               :on-success="handleAvatarSuccess1"
+              :headers="{ token: token }"
               :before-upload="beforeAvatarUpload"
             >
               <img
@@ -303,9 +304,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       dialogVisible: false,
       imageUrl: [],
       limit: 10,
@@ -1197,6 +1200,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.shopId = this.$route.query.shopId;
     this.classifySelect();
     this.taskdataSelect();

+ 5 - 0
src/views/shopsList/shopsList.vue

@@ -568,6 +568,7 @@
             :show-file-list="false"
             :on-success="handleAvatarSuccess1"
             :before-upload="beforeAvatarUpload"
+             :headers="{ token: token }"
           >
             <img
               v-if="shopCover"
@@ -600,6 +601,7 @@
             :show-file-list="false"
             :on-success="handleRemove"
             :on-progress="onprogress1"
+             :headers="{ token: token }"
             :before-upload="beforeAvatarUpload"
           >
             <el-progress
@@ -1526,6 +1528,7 @@
 </template>
 
 <script>
+import Vue from "vue";
 import { jsonp } from "vue-jsonp";
 import {
   provinceAndCityData,
@@ -1541,6 +1544,7 @@ var geocoder,
 export default {
   data() {
     return {
+      token: "",
       routeFlag: true,
       phone: "",
       nickName: "",
@@ -3505,6 +3509,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     let flag = sessionStorage.getItem("shopsListFlag");
     console.log(flag, "shopsListFlag");
 

+ 5 - 1
src/views/sysmission/missionAdd.vue

@@ -42,6 +42,7 @@
           :on-success="handleUploadSuccess"
           list-type="picture-card"
           :on-remove="handleRemove"
+              :headers="{ token: token }"
           :on-change="handleChange"
         >
           <i class="el-icon-plus"></i>
@@ -65,6 +66,7 @@
 </template>
 
 <script>
+import Vue from "vue";
 import load from "./tinymce-components/dynamicLoadScript";
 import toolbar from "./tinymce-components/toolbar";
 import plugins from "./tinymce-components/plugins";
@@ -76,6 +78,7 @@ export default {
   name: "Tinymce",
   data() {
     return {
+      token: "",
       classifyId: "",
       title: "",
       luckyValue: "",
@@ -199,7 +202,7 @@ export default {
           xhr.withCredentials = false;
           xhr.open(
             "POST",
-            "https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload"
+            Tupiantou
           );
           xhr.onload = function() {
             var json;
@@ -280,6 +283,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.init();
     this.classifySelect();
   },

+ 326 - 289
src/views/sysmission/missionRedact.vue

@@ -1,315 +1,352 @@
 <template>
   <div class="components-container main-cont">
     <div style="position: relative;">
-		<span>任务标题:</span>
-		<el-input style="width: 200px;" v-model="title" autosize></el-input>&nbsp;&nbsp;&nbsp;&nbsp;
-		<span>任务分类:</span>
-		<el-select v-model="classifyId" placeholder="请选择任务分类" style="width:200px;">
-			<el-option v-for="(item,index) in artiCletypes" :key="item.index" :label="item.classifyName" :value="item.id">
-			</el-option>
-		</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
-		<span>幸运值:</span>
-		<el-input style="width:200px;" type="number" v-model="luckyValue" autosize></el-input>&nbsp;&nbsp;
-		<div style="display: flex;align-items: center;margin: 2% 0;">
-			<span style="margin-right: 5px;">标题图片:</span>
-			<el-upload
-				v-model="titlePicture"
-				:class="{hide:hideUpload}"
-				  :action="Tupiantou"
-				  :limit=1
-				  :on-success="handleUploadSuccess"
-				  list-type="picture-card"
-				  :on-remove="handleRemove"
-				  :on-change="handleChange"
-				>
-				 <img v-if="titlePicture" :src="titlePicture" class="avatar" style="width: 100%;height: 100%;border-radius: 4px;"/>
-				<i class="el-icon-plus"></i>
-			</el-upload>
-		</div>
-		<div style="position: absolute;right:0;top:5px;">
-			<el-button style='margin:0 0 20px 20px;' size="mini" type="primary" icon="document" @click="artiReleass">修改任务
-			</el-button>
-		</div>
+      <span>任务标题:</span>
+      <el-input style="width: 200px;" v-model="title" autosize></el-input
+      >&nbsp;&nbsp;&nbsp;&nbsp;
+      <span>任务分类:</span>
+      <el-select
+        v-model="classifyId"
+        placeholder="请选择任务分类"
+        style="width:200px;"
+      >
+        <el-option
+          v-for="(item, index) in artiCletypes"
+          :key="item.index"
+          :label="item.classifyName"
+          :value="item.id"
+        >
+        </el-option> </el-select
+      >&nbsp;&nbsp;&nbsp;&nbsp;
+      <span>幸运值:</span>
+      <el-input
+        style="width:200px;"
+        type="number"
+        v-model="luckyValue"
+        autosize
+      ></el-input
+      >&nbsp;&nbsp;
+      <div style="display: flex;align-items: center;margin: 2% 0;">
+        <span style="margin-right: 5px;">标题图片:</span>
+        <el-upload
+          v-model="titlePicture"
+          :class="{ hide: hideUpload }"
+          :action="Tupiantou"
+          :limit="1"
+          :on-success="handleUploadSuccess"
+          list-type="picture-card"
+          :on-remove="handleRemove"
+          :headers="{ token: token }"
+          :on-change="handleChange"
+        >
+          <img
+            v-if="titlePicture"
+            :src="titlePicture"
+            class="avatar"
+            style="width: 100%;height: 100%;border-radius: 4px;"
+          />
+          <i class="el-icon-plus"></i>
+        </el-upload>
+      </div>
+      <div style="position: absolute;right:0;top:5px;">
+        <el-button
+          style="margin:0 0 20px 20px;"
+          size="mini"
+          type="primary"
+          icon="document"
+          @click="artiReleass"
+          >修改任务
+        </el-button>
+      </div>
     </div>
     <div class="tinymce-content">
-      <textarea id="tinymceId" :value="content" class="tinymce-textarea"/>
+      <textarea id="tinymceId" :value="content" class="tinymce-textarea" />
     </div>
   </div>
 </template>
 
 <script>
-    import load from './tinymce-components/dynamicLoadScript'
-    import toolbar from './tinymce-components/toolbar'
-    import plugins from './tinymce-components/plugins'
+import Vue from "vue";
+import load from "./tinymce-components/dynamicLoadScript";
+import toolbar from "./tinymce-components/toolbar";
+import plugins from "./tinymce-components/plugins";
 
-    const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js'
+const tinymceCDN =
+  "https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js";
 
-    export default {
-        name: 'Tinymce',
-        data() {
-            return {
-                classifyId: '',
-                title: '',
-                luckyValue: '',
-				titlePicture:'',
-				isShow: false,
-				hideUpload: false,
-				limit:1,
-				userId:'',
-				id:'',
-                hasChange: false,
-                hasInit: false,
-                tinymceId: 'tinymceId',
-                height: 235,
-                toolbar: [],
-                menubar: 'file edit insert view format table',
-                languageTypeList: {
-                    'en': 'en',
-                    'zh': 'zh_CN'
-                },
-				artiCletypes: [],
-                // 富文本内容
-                content: ''
-            }
-        },
-        watch: {
-            content(val) {
-                if (!this.hasChange && this.hasInit) {
-                    this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val || ''))
-                }
-            }
-        },
-        methods: {
-			handleChange(file, fileList){
-				this.hideUpload = fileList.length >= this.limit;
-			},
-			handleRemove(file, fileList) {
-				this.hideUpload = fileList.length >= this.limit;
-			},
-			//上传成功
-			handleUploadSuccess(file,fileList) {
-			  this.titlePicture= file.data
-			},
-			// 修改任务
-			artiReleass(){
-				if (this.title == '') {
-				    this.$notify({
-				        title: '提示',
-				        duration: 1800,
-				        message: '请输入任务标题',
-				        type: 'warning'
-				    });
-				    return
-				}
-				if (this.classifyId == '') {
-				    this.$notify({
-				        title: '提示',
-				        duration: 1800,
-				        message: '请选择任务分类',
-				        type: 'warning'
-				    });
-				    return
-				}
-				if (this.luckyValue == '') {
-				    this.$notify({
-				        title: '提示',
-				        duration: 1800,
-				        message: '请选择任务幸运值',
-				        type: 'warning'
-				    });
-				    return
-				}
-				if (this.content == '') {
-				    this.$notify({
-				        title: '提示',
-				        duration: 1800,
-				        message: '请选择任务内容',
-				        type: 'warning'
-				    });
-				    return
-				}
-				let id = this.$route.query.id
-				this.$http({
-				  url: this.$http.adornUrl('helpTaskPlatform/updateHelpTaskPlatform'),
-				  method: 'post',
-				  data: this.$http.adornData({
-					 'id':id,
-				    'title':this.title,
-					'state':this.state,
-				    'classifyId':this.classifyId,
-				    'content':this.content,
-				    'luckyValue':this.luckyValue,
-				    'titlePicture':this.titlePicture,
-					'createTime' : this.createTime
-				  })
-				}).then(({data}) => {
-					this.dialogFormVisible = false
-				    this.$message({
-				      message: '修改成功',
-				      type: 'success',
-				      duration: 1500,
-				      onClose: () => {
-				        this.$router.push({path: '/missionsye'});
-				      }
-				    })
-				})
-			},
-            init() {
-                load(tinymceCDN, (err) => {
-                    if (err) {
-                        this.$message.error(err.message)
-                        return
-                    }
-                    this.initTinymce()
-                })
-				let id = this.$route.query.id
-				this.$http({
-					url: this.$http.adornUrl('helpTaskPlatform/selectHelpTaskPlatformById'),
-					method: 'get',
-					params: this.$http.adornParams({
-						'id':id
-					})
-				}).then(({data}) => {
-					let returnData = data.data;
-					this.title = returnData.title
-					this.classifyId = returnData.classifyId
-					this.title = returnData.title
-					this.state = returnData.state
-					this.content = returnData.content
-					this.titlePicture = returnData.titlePicture
-					this.luckyValue = returnData.luckyValue
-					this.createTime = returnData.createTime
-				})
-            },
+export default {
+  name: "Tinymce",
+  data() {
+    return {
+      token: "",
+      classifyId: "",
+      title: "",
+      luckyValue: "",
+      titlePicture: "",
+      isShow: false,
+      hideUpload: false,
+      limit: 1,
+      userId: "",
+      id: "",
+      hasChange: false,
+      hasInit: false,
+      tinymceId: "tinymceId",
+      height: 235,
+      toolbar: [],
+      menubar: "file edit insert view format table",
+      languageTypeList: {
+        en: "en",
+        zh: "zh_CN"
+      },
+      artiCletypes: [],
+      // 富文本内容
+      content: ""
+    };
+  },
+  watch: {
+    content(val) {
+      if (!this.hasChange && this.hasInit) {
+        this.$nextTick(() =>
+          window.tinymce.get(this.tinymceId).setContent(val || "")
+        );
+      }
+    }
+  },
+  methods: {
+    handleChange(file, fileList) {
+      this.hideUpload = fileList.length >= this.limit;
+    },
+    handleRemove(file, fileList) {
+      this.hideUpload = fileList.length >= this.limit;
+    },
+    //上传成功
+    handleUploadSuccess(file, fileList) {
+      this.titlePicture = file.data;
+    },
+    // 修改任务
+    artiReleass() {
+      if (this.title == "") {
+        this.$notify({
+          title: "提示",
+          duration: 1800,
+          message: "请输入任务标题",
+          type: "warning"
+        });
+        return;
+      }
+      if (this.classifyId == "") {
+        this.$notify({
+          title: "提示",
+          duration: 1800,
+          message: "请选择任务分类",
+          type: "warning"
+        });
+        return;
+      }
+      if (this.luckyValue == "") {
+        this.$notify({
+          title: "提示",
+          duration: 1800,
+          message: "请选择任务幸运值",
+          type: "warning"
+        });
+        return;
+      }
+      if (this.content == "") {
+        this.$notify({
+          title: "提示",
+          duration: 1800,
+          message: "请选择任务内容",
+          type: "warning"
+        });
+        return;
+      }
+      let id = this.$route.query.id;
+      this.$http({
+        url: this.$http.adornUrl("helpTaskPlatform/updateHelpTaskPlatform"),
+        method: "post",
+        data: this.$http.adornData({
+          id: id,
+          title: this.title,
+          state: this.state,
+          classifyId: this.classifyId,
+          content: this.content,
+          luckyValue: this.luckyValue,
+          titlePicture: this.titlePicture,
+          createTime: this.createTime
+        })
+      }).then(({ data }) => {
+        this.dialogFormVisible = false;
+        this.$message({
+          message: "修改成功",
+          type: "success",
+          duration: 1500,
+          onClose: () => {
+            this.$router.push({ path: "/missionsye" });
+          }
+        });
+      });
+    },
+    init() {
+      load(tinymceCDN, err => {
+        if (err) {
+          this.$message.error(err.message);
+          return;
+        }
+        this.initTinymce();
+      });
+      let id = this.$route.query.id;
+      this.$http({
+        url: this.$http.adornUrl("helpTaskPlatform/selectHelpTaskPlatformById"),
+        method: "get",
+        params: this.$http.adornParams({
+          id: id
+        })
+      }).then(({ data }) => {
+        let returnData = data.data;
+        this.title = returnData.title;
+        this.classifyId = returnData.classifyId;
+        this.title = returnData.title;
+        this.state = returnData.state;
+        this.content = returnData.content;
+        this.titlePicture = returnData.titlePicture;
+        this.luckyValue = returnData.luckyValue;
+        this.createTime = returnData.createTime;
+      });
+    },
 
-            initTinymce() {
-                const _this = this
-                window.tinymce.init({
-                    selector: `#${this.tinymceId}`,
-                    images_upload_handler: function (blobInfo, success, failure) {
-                        var xhr, formData;
+    initTinymce() {
+      const _this = this;
+      window.tinymce.init({
+        selector: `#${this.tinymceId}`,
+        images_upload_handler: function(blobInfo, success, failure) {
+          var xhr, formData;
 
-                        xhr = new XMLHttpRequest();
-                        xhr.withCredentials = false;
-                        xhr.open('POST', "https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload");
-                        xhr.onload = function () {
-                            var json;
+          xhr = new XMLHttpRequest();
+          xhr.withCredentials = false;
+          xhr.open(
+            "POST",
+            Tupiantou
+          );
+          xhr.onload = function() {
+            var json;
 
-                            if (xhr.status != 200) {
-                                failure('HTTP Error: ' + xhr.status);
-                                return;
-                            }
-                            json = xhr.responseText;
-                            if (json == "" || json == null) {
-                                failure('Invalid JSON: ' + xhr.responseText);
-                                return;
-                            }
-                            success(json);
-                        };
-                        formData = new FormData();
-                        formData.append('file', blobInfo.blob(), blobInfo.filename());
-                        xhr.send(formData);
-                    },
-                    language: this.languageTypeList['zh'],
-                    height: this.height,
-                    body_class: 'panel-body ',
-                    object_resizing: false,
-                    toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
-                    plugins,
-                    menubar: this.menubar,
-                    end_container_on_empty_block: true,
-                    powerpaste_word_import: 'clean',
-                    code_dialog_height: 450,
-                    code_dialog_width: 1000,
-                    advlist_bullet_styles: 'square',
-                    advlist_number_styles: 'default',
-                    imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
-                    default_link_target: '_blank',
-                    link_title: false,
-                    // Image
-                    imagetools_toolbar: 'rotateleft rotateright | flipv fliph | editimage imageoptions',
-                    nonbreaking_force_tab: true, // inserting nonbreaking space &nbsp; need Nonbreaking Space Plugin
-                    init_instance_callback: editor => {
-                        if (_this.content) {
-                            editor.setContent(_this.content)
-                        }
-                        _this.hasInit = true
-                        editor.on('NodeChange Change KeyUp SetContent', () => {
-                            this.hasChange = true
-                            this.content = editor.getContent()
-                        })
-                    },
-                    setup(editor) {
-                        editor.on('FullscreenStateChanged', (e) => {
-                            _this.fullscreen = e.state
-                        })
-                    }
-                })
-            },
-            destroyTinymce() {
-                const tinymce = window.tinymce.get(this.tinymceId)
-                if (this.fullscreen) {
-                    tinymce.execCommand('mceFullScreen')
-                }
-                if (tinymce) {
-                    tinymce.destroy()
-                }
-            },
-			// 获取分类
-			classifySelect () {
-			  this.tableDataLoading = true
-			  this.$http({
-				url: this.$http.adornUrl('platformClassify/selectClassifyList'),
-				method: 'get',
-				params: this.$http.adornParams({
-				})
-			  }).then(({data}) => {
-					this.tableDataLoading = false
-					let returnData = data.data;
-					this.artiCletypes = returnData
-			  })
-			},
-        },
-        mounted() {
-            this.init()
-			this.classifySelect()
-        },
-        beforeDestroy() {
-            this.destroyTinymce()
-        },
-        activated() {
-            if (window.tinymce) {
-                this.initTinymce()
+            if (xhr.status != 200) {
+              failure("HTTP Error: " + xhr.status);
+              return;
             }
+            json = xhr.responseText;
+            if (json == "" || json == null) {
+              failure("Invalid JSON: " + xhr.responseText);
+              return;
+            }
+            success(json);
+          };
+          formData = new FormData();
+          formData.append("file", blobInfo.blob(), blobInfo.filename());
+          xhr.send(formData);
+        },
+        language: this.languageTypeList["zh"],
+        height: this.height,
+        body_class: "panel-body ",
+        object_resizing: false,
+        toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
+        plugins,
+        menubar: this.menubar,
+        end_container_on_empty_block: true,
+        powerpaste_word_import: "clean",
+        code_dialog_height: 450,
+        code_dialog_width: 1000,
+        advlist_bullet_styles: "square",
+        advlist_number_styles: "default",
+        imagetools_cors_hosts: ["www.tinymce.com", "codepen.io"],
+        default_link_target: "_blank",
+        link_title: false,
+        // Image
+        imagetools_toolbar:
+          "rotateleft rotateright | flipv fliph | editimage imageoptions",
+        nonbreaking_force_tab: true, // inserting nonbreaking space &nbsp; need Nonbreaking Space Plugin
+        init_instance_callback: editor => {
+          if (_this.content) {
+            editor.setContent(_this.content);
+          }
+          _this.hasInit = true;
+          editor.on("NodeChange Change KeyUp SetContent", () => {
+            this.hasChange = true;
+            this.content = editor.getContent();
+          });
         },
-        deactivated() {
-            this.destroyTinymce()
+        setup(editor) {
+          editor.on("FullscreenStateChanged", e => {
+            _this.fullscreen = e.state;
+          });
         }
+      });
+    },
+    destroyTinymce() {
+      const tinymce = window.tinymce.get(this.tinymceId);
+      if (this.fullscreen) {
+        tinymce.execCommand("mceFullScreen");
+      }
+      if (tinymce) {
+        tinymce.destroy();
+      }
+    },
+    // 获取分类
+    classifySelect() {
+      this.tableDataLoading = true;
+      this.$http({
+        url: this.$http.adornUrl("platformClassify/selectClassifyList"),
+        method: "get",
+        params: this.$http.adornParams({})
+      }).then(({ data }) => {
+        this.tableDataLoading = false;
+        let returnData = data.data;
+        this.artiCletypes = returnData;
+      });
     }
+  },
+  mounted() {
+    this.token = Vue.cookie.get("token");
+    this.init();
+    this.classifySelect();
+  },
+  beforeDestroy() {
+    this.destroyTinymce();
+  },
+  activated() {
+    if (window.tinymce) {
+      this.initTinymce();
+    }
+  },
+  deactivated() {
+    this.destroyTinymce();
+  }
+};
 </script>
 
 <style>
-  .main-cont {
-    max-width: 100%;
-    min-width: 80%;
-	padding-bottom:5%;
-	background-color: #fff;
-  }
+.main-cont {
+  max-width: 100%;
+  min-width: 80%;
+  padding-bottom: 5%;
+  background-color: #fff;
+}
 
-  .tinymce-container {
-    position: relative;
-    line-height: normal;
-  }
+.tinymce-container {
+  position: relative;
+  line-height: normal;
+}
 
-  .tinymce-container >>> .mce-fullscreen {
-    z-index: 10000;
-  }
+.tinymce-container >>> .mce-fullscreen {
+  z-index: 10000;
+}
 
-  .tinymce-textarea {
-    visibility: hidden;
-    z-index: -1;
-  }
- .hide .el-upload--picture-card {
-     display: none;
- }
+.tinymce-textarea {
+  visibility: hidden;
+  z-index: -1;
+}
+.hide .el-upload--picture-card {
+  display: none;
+}
 </style>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1135 - 0
src/views/vueMchat/vueMchat copy.vue


+ 4 - 0
src/views/vueMchat/vueMchat.vue

@@ -301,6 +301,7 @@
                   :show-file-list="false"
                   :on-success="handleAvatarSuccess"
                   :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
                 >
                   <div class="icon-item" title="发送文件">
                     <img
@@ -342,9 +343,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       activeName: "3",
       userType: 0,
       timeSel: [],
@@ -734,6 +737,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     console.log("mounted");
     // this.timer = window.setInterval(() => {
     //   setTimeout(() => {