소스 검색

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

hzj18279462576@163.com 7 달 전
부모
커밋
6baa9f671d

+ 2 - 2
config/index.js

@@ -16,9 +16,9 @@ module.exports = {
       '/proxyApi': {
         // target: 'http://iyfpk3.natappfree.cc/sqx_fast',
 
-        target: 'https://mxys.chuanghai-tech.com/sqx_fast/',//mxys.chuanghai-tech.com
+        // target: 'https://mxys.chuanghai-tech.com/sqx_fast/',//mxys.chuanghai-tech.com
         // target: 'http://192.168.161.190:8171/sqx_fast/',
-        // target: 'https://mxys.chuanghai-tech.com/wm-test/wm-api',//mxys.chuanghai-tech.com
+        target: 'https://mxys.chuanghai-tech.com/wm-test/wm-api',//mxys.chuanghai-tech.com
 		    changeOrigin: true,
         pathRewrite: {
           '^/proxyApi': ''

+ 5 - 0
npm-shrinkwrap.json

@@ -8588,6 +8588,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

@@ -27,6 +27,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",

+ 3 - 2
src/main.js

@@ -14,9 +14,10 @@ import '@/assets/styles/fonts.css' //字体样式
 import * as imageConversion from 'image-conversion';
 import { getCompressionQuality, compressImage } from '@/utils/compressionUtils.js';
 
-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/sqx_fast/admin/new-file/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/wm-test/wm-api/sqx_fast/admin/new-file/upload'//线下
 Vue.prototype.Tupian =function(img){
 	return 'https://mxys.chuanghai-tech.com/wmfile'+img
 }//全局图片请求头

+ 106 - 86
src/utils/httpRequest.js

@@ -1,93 +1,112 @@
-import Vue from 'vue'
-import axios from 'axios'
-import router from '@/router'
-import qs from 'qs'
-import merge from 'lodash/merge'
-import { clearLoginInfo } from '@/utils'
+import Vue from "vue";
+import axios from "axios";
+import router from "@/router";
+import qs from "qs";
+import merge from "lodash/merge";
+import { clearLoginInfo } from "@/utils";
 import {
   encrypt,
   decrypt,
   urlSafeBase64Decode,
   urlSafeBase64Encode
-} from '../utils/cryptojs';
-var ifShangxian=1//1线上,0线下   /login页面还有一个验证码请求参加密
+} from "../utils/cryptojs";
+var ifShangxian = 1; //1线上,0线下   /login页面还有一个验证码请求参加密
 
 const http = axios.create({
   timeout: 1000 * 30,
   // withCredentials: true,
   headers: {
-    'Content-Type': 'application/json; charset=utf-8'
+    "Content-Type": "application/json; charset=utf-8"
   }
-})
+});
 
 /**
  * 请求拦截
  */
-http.interceptors.request.use(config => {
-  config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
-  return config
-}, error => {
-  return Promise.reject(error)
-})
+http.interceptors.request.use(
+  config => {
+    config.headers["token"] = Vue.cookie.get("token"); // 请求头带上token
+    return config;
+  },
+  error => {
+    return Promise.reject(error);
+  }
+);
 
 /**
  * 响应拦截
  */
-http.interceptors.response.use(response => {
-  if (response.data && response.data.code === 401) { // 401, token失效
-  sessionStorage.clear()
-    clearLoginInfo()
-    router.push({ name: 'login' })
-  }
-  if(ifShangxian==1){
-    if(response.data.type){
-    }else{
-      const decryptData =decrypt(urlSafeBase64Decode(response.data))
-      response.data=JSON.parse(decryptData)
+http.interceptors.response.use(
+  response => {
+    if (response.data && response.data.code === 401) {
+      // 401, token失效
+      sessionStorage.clear();
+      clearLoginInfo();
+      router.push({ name: "login" });
     }
+
+    // console.log(
+    //   decrypt(
+    //     urlSafeBase64Decode("nhUrbnqOHepMHbB7tPBn_oOaLdbWPDlhp_SyK75Q_F8Mr_Px-jDaRuofsndXokxjArrhMVMsW7ZftyVcoahqTn25Q0uH-URoPr2F_xucqb_XK8mVoeMXkiJRaBqj8pnw")
+    //   ),
+    //   "11111111111111111111111111"
+    // );
+
+    if (ifShangxian == 1) {
+      if (response.data.type) {
+      } else {
+        const decryptData = decrypt(urlSafeBase64Decode(response.data));
+        response.data = JSON.parse(decryptData);
+      }
+    }
+    return response;
+  },
+  error => {
+    return Promise.reject(error);
   }
-  return response
-}, error => {
-  return Promise.reject(error)
-})
+);
 
 /**
  * 请求地址处理
  * @param {*} actionName action方法名称
  */
-http.adornUrl = (actionName) => {
+http.adornUrl = actionName => {
   // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
   // return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
-// return 'https://chtech.ncjti.edu.cn/testingServer/waiMaiAdmin/' + actionName}
-// return 'http://iyfpk3.natappfree.cc/sqx_fast/' + actionName
+  // return 'https://chtech.ncjti.edu.cn/testingServer/waiMaiAdmin/' + actionName}
+  // return 'http://iyfpk3.natappfree.cc/sqx_fast/' + actionName
 
-return 'https://mxys.chuanghai-tech.com/sqx_fast/' + actionName
-// return 'http://192.168.161.190:8171/sqx_fast/' + actionName
-// return 'https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast/' + actionName
-}
+  // return 'https://mxys.chuanghai-tech.com/sqx_fast/' + actionName
+  // return 'http://192.168.161.190:8171/sqx_fast/' + actionName
+  return (
+    "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast/" + actionName
+  );
+};
 
-http.adornUrl2 = (actionName) => {
+http.adornUrl2 = actionName => {
   // 非生产环境 && 开启代理, 接口前缀统一使用[/tao/]前缀做代理拦截!
   // return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/tao/' : window.SITE_CONFIG.baseUrl) + actionName
-	return '/api' + actionName
-}
-http.adornUrlMsg = (actionName) => {
+  return "/api" + actionName;
+};
+http.adornUrlMsg = actionName => {
   // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
   // return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
-// return 'https://chtech.ncjti.edu.cn/testingServer/waiMaiAdmin/' + actionName}
-// return 'http://iyfpk3.natappfree.cc/sqx_fast/' + actionName
+  // return 'https://chtech.ncjti.edu.cn/testingServer/waiMaiAdmin/' + actionName}
+  // return 'http://iyfpk3.natappfree.cc/sqx_fast/' + actionName
 
-return 'https://mxys.chuanghai-tech.com/sqx_fast/' + actionName
-// return 'http://192.168.161.190:8171/sqx_fast/' + actionName
-// return 'https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast/' + actionName
-}
-http.adornWss = (actionName) => {
+  // return 'https://mxys.chuanghai-tech.com/sqx_fast/' + actionName
+  // return 'http://192.168.161.190:8171/sqx_fast/' + actionName
+  return (
+    "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast/" + actionName
+  );
+};
+http.adornWss = actionName => {
   // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
   // return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
-	// return 'wss://www.daweilinli.com/wss/' + actionName
-	return 'wss://mxys.chuanghai-tech.com/wss/' + actionName
-	// return 'wss://mxys.chuanghai-tech.com/wss-test/' + actionName
-}
+  // return 'wss://www.daweilinli.com/wss/' + actionName
+  // return 'wss://mxys.chuanghai-tech.com/wss/' + actionName
+  return "wss://mxys.chuanghai-tech.com/wss-test/" + actionName;
+};
 /**
  * get请求参数处理
  * @param {*} params 参数对象
@@ -95,29 +114,29 @@ http.adornWss = (actionName) => {
  */
 http.adornParams = (params = {}, openDefultParams = false) => {
   var defaults = {
-    't': new Date().getTime()
-  }
-  if(ifShangxian==1){
-    if(params){
+    t: new Date().getTime()
+  };
+  if (ifShangxian == 1) {
+    if (params) {
       // console.log(params,'gggg2')
-				var arr =Object.entries(params)//对象转为数组
-				var b=[]
-				arr.forEach((element, index) => {
-					arr[index][1] = urlSafeBase64Encode(encrypt(element[1].toString()))
-				});
-				b=arr
-			var	acc=Object.fromEntries(b)//数值还原
-      var returnItem = openDefultParams ? merge(defaults, acc) : acc//线上
+      var arr = Object.entries(params); //对象转为数组
+      var b = [];
+      arr.forEach((element, index) => {
+        arr[index][1] = urlSafeBase64Encode(encrypt(element[1].toString()));
+      });
+      b = arr;
+      var acc = Object.fromEntries(b); //数值还原
+      var returnItem = openDefultParams ? merge(defaults, acc) : acc; //线上
       // console.log(returnItem,'gggg2')
-      return returnItem
+      return returnItem;
       // return urlSafeBase64Encode(encrypt(returnItem.toString())) // **加密**
-    }else{
-      return openDefultParams ? merge(defaults, params) : params
+    } else {
+      return openDefultParams ? merge(defaults, params) : params;
     }
-  }else{
-    return openDefultParams ? merge(defaults, params) : params//测试版
+  } else {
+    return openDefultParams ? merge(defaults, params) : params; //测试版
   }
-}
+};
 
 /**
  * post请求数据处理
@@ -127,22 +146,23 @@ http.adornParams = (params = {}, openDefultParams = false) => {
  *  json: 'application/json; charset=utf-8'
  *  form: 'application/x-www-form-urlencoded; charset=utf-8'
  */
-http.adornData = (data = {}, openDefultdata = false, contentType = 'json') => {
+http.adornData = (data = {}, openDefultdata = false, contentType = "json") => {
   var defaults = {
-    't': new Date().getTime()
-  }
-  data = openDefultdata ? merge(defaults, data) : data
-  if(ifShangxian==1){
-    if(data){
-      console.log(data)
-      var returnItem = contentType === 'json' ? JSON.stringify(data) : qs.stringify(data)
-      return '"' + urlSafeBase64Encode(encrypt(returnItem.toString())) + '"' // **加密**
-    }else{
-      return contentType === 'json' ? JSON.stringify(data) : qs.stringify(data)
+    t: new Date().getTime()
+  };
+  data = openDefultdata ? merge(defaults, data) : data;
+  if (ifShangxian == 1) {
+    if (data) {
+      console.log(data);
+      var returnItem =
+        contentType === "json" ? JSON.stringify(data) : qs.stringify(data);
+      return '"' + urlSafeBase64Encode(encrypt(returnItem.toString())) + '"'; // **加密**
+    } else {
+      return contentType === "json" ? JSON.stringify(data) : qs.stringify(data);
     }
-  }else{
-    return contentType === 'json' ? JSON.stringify(data) : qs.stringify(data)
+  } else {
+    return contentType === "json" ? JSON.stringify(data) : qs.stringify(data);
   }
-}
+};
 
-export default http
+export default http;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 499 - 344
src/views/allocation/allocationList.vue


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

@@ -1,96 +1,97 @@
-/*富文本编辑图片上传配置*/
-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 // 事件重写
+    }
+  }
+};

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1202 - 1042
src/views/banner/bannerList.vue


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 685 - 463
src/views/common/merchant.vue


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 668 - 431
src/views/common/merchantClone.vue


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

@@ -91,6 +91,7 @@
             :show-file-list="false"
             :on-success="handleAvatarSuccess1"
 :before-upload="beforeAvatarUpload"
+             :headers="{ token: token }"
           >
             <img
               v-if="couponPicture"
@@ -167,6 +168,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess2"
               :before-upload="beforeAvatarUpload"
+             :headers="{ token: token }"
             >
               <img
                 v-if="form.couponPicture"
@@ -331,9 +333,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       limit: 10,
       page: 1,
       size1: 10,
@@ -744,6 +748,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.shopId = this.$cookie.get("shopId");
     this.dataSelect();
   }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1435 - 1429
src/views/fitment/fitmentList.vue


+ 1 - 0
src/views/main-navbar.vue

@@ -459,6 +459,7 @@
 		},
 		beforeDestroy() {
 			clearInterval(this.chatNum)
+			clearInterval(this.chatNum2)
 		},
 		watch: {
 			// 'chatNum': function() {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 596 - 507
src/views/materials/materialsList.vue


+ 286 - 246
src/views/members/vipPrivilege.vue

@@ -1,246 +1,286 @@
-<template>
-  <div>
-    <div style="float: right;margin-right:2%;">
-      <el-button style='margin: 10px 0;' :disabled="!isAuth('bannerList:add')" size="mini" type="primary"
-        icon="document" @click="addNotice">添加会员特权</el-button>
-    </div>
-    <el-table v-loading="tableDataLoading" :data="tableData.list">
-
-      <el-table-column fixed prop="memberId" label="编号" width="50">
-      </el-table-column>
-      <el-table-column prop="memberImg" label="图片">
-        <template slot-scope="scope">
-            <img :src="scope.row.memberImg" width="60" height="60" />
-        </template>
-      </el-table-column>
-      <el-table-column prop="memberName" label="特权名称">
-      </el-table-column>
-      <el-table-column prop="sort" label="排序">
-      </el-table-column>
-      <el-table-column label="操作" width="180">
-        <template slot-scope="scope">
-          <el-button size="mini" type="primary" :disabled="!isAuth('bannerList:update')"
-            @click="amendBanner(scope.$index, scope.row)">修改
-          </el-button>
-          <el-button size="mini" type="danger" :disabled="!isAuth('bannerList:delete')" @click="deletes(scope.row)">删除
-          </el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div style="text-align: center;margin-top: 10px;">
-      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-        :page-sizes="[10, 20, 30, 50, 100]" :page-size="limit" :current-page="page"
-        layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
-      </el-pagination>
-    </div>
-    <el-dialog :title="title" :visible.sync="dialogFormVisible" center>
-      <div style="margin-bottom: 10px;display: flex;">
-        <span style="width: 200px;display: inline-block;text-align: right;">图片:</span>
-        <div
-          style=" width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
-          <el-upload class="avatar-uploader" v-model="memberImg"
- action="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload" :show-file-list="false"
-            :on-success="handleAvatarSuccess">
-            <img v-if="memberImg" :src="memberImg" class="avatar"
-              style="border-radius: 6px;width: 148px;height: 148px;" />
-            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-          </el-upload>
-        </div>
-      </div>
-      <div style="margin-bottom: 10px;">
-        <span style="width: 200px;display: inline-block;text-align: right;">名称:</span>
-        <el-input style="width:50%;" v-model="memberName" placeholder="请输入名称"></el-input>
-      </div>
-      <div style="margin-bottom: 10px;">
-        <span style="width: 200px;display: inline-block;text-align: right;">排序:</span>
-        <el-input style="width:50%;" v-model="sort" placeholder="请输入排序"
-          onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></el-input>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="dialogFormVisible = false">取 消</el-button>
-        <el-button type="primary" @click="addNoticeTo()">确 定</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-  export default {
-    data() {
-      return {
-        page: 1,
-        limit: 10,
-        tableDataLoading: true,
-        dialogFormVisible: false,
-        tableData: [],
-        memberName: '',
-        memberImg: '',
-        memberId: '',
-        sort: '',
-        title: '添加'
-      }
-    },
-    methods: {
-      // 获取数据列表
-      dataSelect() {
-        this.tableDataLoading = true
-        this.$http({
-          url: this.$http.adornUrl('member/selectMemberPage'),
-          method: 'get',
-          params: this.$http.adornParams({
-            'page': this.page,
-            'limit': this.limit
-          })
-        }).then(({
-          data
-        }) => {
-          if (data && data.code === 0) {
-            console.log('会员列表', data)
-            this.tableDataLoading = false
-            let returnData = data.data;
-            this.tableData = returnData;
-          }
-
-        })
-      },
-      //上传成功
-      handleAvatarSuccess(file) {
-        this.memberImg = file.data
-      },
-      addNotice() {
-        this.dialogFormVisible = true
-      },
-      handleCurrentChange(val) {
-        this.page = val
-        this.dataSelect()
-      },
-      handleSizeChange(val) {
-        this.limit = val
-        this.dataSelect()
-      },
-      // 添加banner图
-      addNoticeTo() {
-        if (this.memberImg == '') {
-          this.$notify({
-            title: '提示',
-            duration: 1800,
-            message: '请上传图片',
-            type: 'warning'
-          });
-          return
-        }
-        if (this.memberName == '') {
-          this.$notify({
-            title: '提示',
-            duration: 1800,
-            message: '请输入名称',
-            type: 'warning'
-          });
-          return
-        }
-        this.classify = 1
-        if (this.title == '添加') {
-          var url = 'member/insertMember'
-        } else {
-          var url = 'member/updateMember'
-        }
-        this.$http({
-          url: this.$http.adornUrl(url),
-          method: 'post',
-          data: this.$http.adornData({
-            'memberImg': this.memberImg,
-            'memberId': this.memberId,
-            'memberName': this.memberName,
-            'sort': this.sort
-          })
-        }).then(({
-          data
-        }) => {
-          this.dialogFormVisible = false
-          this.$message({
-            message: '操作成功',
-            type: 'success',
-            duration: 1500,
-            onClose: () => {
-              this.memberImg = ''
-              this.memberId = ''
-              this.memberName = ''
-              this.sort = ''
-              this.title = '添加'
-              this.dataSelect()
-            }
-          })
-        })
-      },
-      // 修改
-      amendBanner(index, rows, a) {
-        if (a == 1) {
-          this.pl = 1
-        } else {
-          this.pl = 0
-        }
-        this.dialogFormVisible = true
-        this.id = rows.id
-        this.memberImg = rows.memberImg
-        this.memberId = rows.memberId
-        this.sort = rows.sort
-        this.memberName = rows.memberName
-        this.title = '修改'
-      },
-      // 修改
-      amendNoticeTo() {
-        this.$http({
-          url: this.$http.adornUrl(
-            `?memberId=${this.memberId}&memberImg=${this.memberImg}&sort=${this.sort}&memberName=${this.memberName}`
-            ),
-          method: 'post',
-          data: this.$http.adornData({})
-        }).then(({
-          data
-        }) => {
-          this.dialogFormVisible = false
-          this.$message({
-            message: '操作成功',
-            type: 'success',
-            duration: 1500,
-            onClose: () => {
-              this.dataSelect()
-            }
-          })
-        })
-      },
-      //删除一级
-      deletes(row) {
-        let delid = row.memberId
-        this.$confirm(`确定删除此条信息?`, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          this.$http({
-            url: this.$http.adornUrl(`member/deleteMemberById/?memberId=${delid}`),
-            method: 'post',
-            data: this.$http.adornData({})
-          }).then(({
-            data
-          }) => {
-            this.$message({
-              message: '删除成功',
-              type: 'success',
-              duration: 1500,
-              onClose: () => {
-                this.dataSelect()
-              }
-            })
-          })
-        }).catch(() => {})
-      },
-    },
-    mounted() {
-      this.dataSelect()
-    }
-  }
-</script>
-
-<style>
-</style>
+<template>
+  <div>
+    <div style="float: right;margin-right:2%;">
+      <el-button
+        style="margin: 10px 0;"
+        :disabled="!isAuth('bannerList:add')"
+        size="mini"
+        type="primary"
+        icon="document"
+        @click="addNotice"
+        >添加会员特权</el-button
+      >
+    </div>
+    <el-table v-loading="tableDataLoading" :data="tableData.list">
+      <el-table-column fixed prop="memberId" label="编号" width="50">
+      </el-table-column>
+      <el-table-column prop="memberImg" label="图片">
+        <template slot-scope="scope">
+          <img :src="scope.row.memberImg" width="60" height="60" />
+        </template>
+      </el-table-column>
+      <el-table-column prop="memberName" label="特权名称"> </el-table-column>
+      <el-table-column prop="sort" label="排序"> </el-table-column>
+      <el-table-column label="操作" width="180">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="primary"
+            :disabled="!isAuth('bannerList:update')"
+            @click="amendBanner(scope.$index, scope.row)"
+            >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="danger"
+            :disabled="!isAuth('bannerList:delete')"
+            @click="deletes(scope.row)"
+            >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="text-align: center;margin-top: 10px;">
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :page-sizes="[10, 20, 30, 50, 100]"
+        :page-size="limit"
+        :current-page="page"
+        layout="total,sizes, prev, pager, next,jumper"
+        :total="tableData.totalCount"
+      >
+      </el-pagination>
+    </div>
+    <el-dialog :title="title" :visible.sync="dialogFormVisible" center>
+      <div style="margin-bottom: 10px;display: flex;">
+        <span style="width: 200px;display: inline-block;text-align: right;"
+          >图片:</span
+        >
+        <div
+          style=" width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;"
+        >
+          <el-upload
+            class="avatar-uploader"
+            v-model="memberImg"
+            :action="Tupiantou"
+          :headers="{ token: token }"
+            :show-file-list="false"
+            :on-success="handleAvatarSuccess"
+          >
+            <img
+              v-if="memberImg"
+              :src="memberImg"
+              class="avatar"
+              style="border-radius: 6px;width: 148px;height: 148px;"
+            />
+            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+          </el-upload>
+        </div>
+      </div>
+      <div style="margin-bottom: 10px;">
+        <span style="width: 200px;display: inline-block;text-align: right;"
+          >名称:</span
+        >
+        <el-input
+          style="width:50%;"
+          v-model="memberName"
+          placeholder="请输入名称"
+        ></el-input>
+      </div>
+      <div style="margin-bottom: 10px;">
+        <span style="width: 200px;display: inline-block;text-align: right;"
+          >排序:</span
+        >
+        <el-input
+          style="width:50%;"
+          v-model="sort"
+          placeholder="请输入排序"
+          onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
+        ></el-input>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addNoticeTo()">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import Vue from "vue";
+export default {
+  data() {
+    return {
+      token: "",
+      page: 1,
+      limit: 10,
+      tableDataLoading: true,
+      dialogFormVisible: false,
+      tableData: [],
+      memberName: "",
+      memberImg: "",
+      memberId: "",
+      sort: "",
+      title: "添加"
+    };
+  },
+  methods: {
+    // 获取数据列表
+    dataSelect() {
+      this.tableDataLoading = true;
+      this.$http({
+        url: this.$http.adornUrl("member/selectMemberPage"),
+        method: "get",
+        params: this.$http.adornParams({
+          page: this.page,
+          limit: this.limit
+        })
+      }).then(({ data }) => {
+        if (data && data.code === 0) {
+          console.log("会员列表", data);
+          this.tableDataLoading = false;
+          let returnData = data.data;
+          this.tableData = returnData;
+        }
+      });
+    },
+    //上传成功
+    handleAvatarSuccess(file) {
+      this.memberImg = file.data;
+    },
+    addNotice() {
+      this.dialogFormVisible = true;
+    },
+    handleCurrentChange(val) {
+      this.page = val;
+      this.dataSelect();
+    },
+    handleSizeChange(val) {
+      this.limit = val;
+      this.dataSelect();
+    },
+    // 添加banner图
+    addNoticeTo() {
+      if (this.memberImg == "") {
+        this.$notify({
+          title: "提示",
+          duration: 1800,
+          message: "请上传图片",
+          type: "warning"
+        });
+        return;
+      }
+      if (this.memberName == "") {
+        this.$notify({
+          title: "提示",
+          duration: 1800,
+          message: "请输入名称",
+          type: "warning"
+        });
+        return;
+      }
+      this.classify = 1;
+      if (this.title == "添加") {
+        var url = "member/insertMember";
+      } else {
+        var url = "member/updateMember";
+      }
+      this.$http({
+        url: this.$http.adornUrl(url),
+        method: "post",
+        data: this.$http.adornData({
+          memberImg: this.memberImg,
+          memberId: this.memberId,
+          memberName: this.memberName,
+          sort: this.sort
+        })
+      }).then(({ data }) => {
+        this.dialogFormVisible = false;
+        this.$message({
+          message: "操作成功",
+          type: "success",
+          duration: 1500,
+          onClose: () => {
+            this.memberImg = "";
+            this.memberId = "";
+            this.memberName = "";
+            this.sort = "";
+            this.title = "添加";
+            this.dataSelect();
+          }
+        });
+      });
+    },
+    // 修改
+    amendBanner(index, rows, a) {
+      if (a == 1) {
+        this.pl = 1;
+      } else {
+        this.pl = 0;
+      }
+      this.dialogFormVisible = true;
+      this.id = rows.id;
+      this.memberImg = rows.memberImg;
+      this.memberId = rows.memberId;
+      this.sort = rows.sort;
+      this.memberName = rows.memberName;
+      this.title = "修改";
+    },
+    // 修改
+    amendNoticeTo() {
+      this.$http({
+        url: this.$http.adornUrl(
+          `?memberId=${this.memberId}&memberImg=${this.memberImg}&sort=${this.sort}&memberName=${this.memberName}`
+        ),
+        method: "post",
+        data: this.$http.adornData({})
+      }).then(({ data }) => {
+        this.dialogFormVisible = false;
+        this.$message({
+          message: "操作成功",
+          type: "success",
+          duration: 1500,
+          onClose: () => {
+            this.dataSelect();
+          }
+        });
+      });
+    },
+    //删除一级
+    deletes(row) {
+      let delid = row.memberId;
+      this.$confirm(`确定删除此条信息?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.$http({
+            url: this.$http.adornUrl(
+              `member/deleteMemberById/?memberId=${delid}`
+            ),
+            method: "post",
+            data: this.$http.adornData({})
+          }).then(({ data }) => {
+            this.$message({
+              message: "删除成功",
+              type: "success",
+              duration: 1500,
+              onClose: () => {
+                this.dataSelect();
+              }
+            });
+          });
+        })
+        .catch(() => {});
+    }
+  },
+  mounted() {
+    this.token = Vue.cookie.get("token");
+    this.dataSelect();
+  }
+};
+</script>
+
+<style></style>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1597 - 1591
src/views/mission/system.vue


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1359 - 1193
src/views/runErrands/bannerList.vue


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

@@ -1,96 +1,97 @@
-/*富文本编辑图片上传配置*/
-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  // 事件重写
+        }
+    }
+};

+ 10 - 2
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"
@@ -218,6 +219,7 @@
               :on-change="handleChange"
               :on-remove="handleRemove"
               :before-upload="beforeAvatarUpload"
+             :headers="{ token: token }"
             >
               <i class="el-icon-plus"></i>
             </el-upload>
@@ -434,7 +436,8 @@
                     <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="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload" :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"/>
@@ -509,7 +512,8 @@
                     <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="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload" :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"/>
@@ -582,6 +586,7 @@
             :on-success="handleUploadSuccessXq"
             :on-progress="onprogress1"
             :before-upload="beforeAvatarUpload"
+             :headers="{ token: token }"
             >
             <el-progress
               v-if="percentage1 > 0 && percentage1 < 100"
@@ -618,6 +623,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";
@@ -631,6 +637,7 @@ export default {
   name: "Tinymce",
   data() {
     return {
+      token: "",
       tableDataLoading: true,
       originalPrice: "",
       price: "",
@@ -1488,6 +1495,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.init();
     this.specifSelect();
     window.scrollTo(0, 0);

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1102 - 1095
src/views/selfShop/shopConfig.vue


+ 20 - 10
src/views/selfShop/shopPublish.vue

@@ -229,6 +229,7 @@
               :show-file-list="false"
               :on-success="handleAvatarSuccess1"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <img
                 v-if="goodsCover"
@@ -248,16 +249,16 @@
           style="display: flex;align-items: center;margin: 2% 0;flex-flow: wrap;"
         >
           <span style="display: inline-block;text-align: right;"
-            >商品轮播图:<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"
                 class="avatar"
                 style="width:148px;height: 148px;"
               />
-              <div @click="handleRemove(index)" class="divhove">
+              <div @click="clearEdit(index)" class="divhove">
                 <i
                   class="el-icon-delete"
                   style="margin: 0;font-size: 18px;color: #fff;"
@@ -272,8 +273,8 @@
               :show-file-list="false"
               :on-success="handleUploadSuccess"
               :on-change="handleChange"
-              :on-remove="handleRemove"
               :before-upload="beforeAvatarUpload"
+              :headers="{ token: token }"
             >
               <i class="el-icon-plus"></i>
             </el-upload>
@@ -584,7 +585,8 @@
                   <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="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload" :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" />
@@ -683,6 +685,7 @@
             :on-success="handleUploadSuccessXq"
             :on-progress="onprogress1"
             :before-upload="beforeAvatarUpload"
+            :headers="{ token: token }"
           >
             <el-progress
               v-if="percentage1 > 0 && percentage1 < 100"
@@ -815,6 +818,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";
@@ -828,6 +832,7 @@ export default {
   name: "Tinymce",
   data() {
     return {
+      token: "",
       specif: "",
       typeId: "",
       goodsName: "",
@@ -1062,6 +1067,10 @@ export default {
       }
       console.log("this.potost", this.potost);
     },
+    clearEdit(index) {
+      console.log(index);
+      this.potost.splice(index, 1);
+    },
     handleAvatarSuccess1(file, fileList) {
       this.goodsCover = file.data;
     },
@@ -1069,8 +1078,8 @@ export default {
     handleUploadSuccess(file, fileList) {
       // this.goodsPicture += file.data + ','
       // this.potost.push(file.data);
-      if(this.potost.length>=4){
-        this.potost.shift()
+      if (this.potost.length >= 4) {
+        this.potost.shift();
       }
       this.potost.unshift(file.data);
     },
@@ -1564,8 +1573,8 @@ export default {
     //上传成功
     handleUploadSuccessXq(file, fileList) {
       // this.goodsParticularsPicture.push(file.data);
-      if(this.goodsParticularsPicture.length>=4){
-        this.goodsParticularsPicture.shift()
+      if (this.goodsParticularsPicture.length >= 4) {
+        this.goodsParticularsPicture.shift();
       }
       this.goodsParticularsPicture.unshift(file.data);
     },
@@ -1831,6 +1840,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.shopId = this.$route.query.shopId;
     console.log("shopId:", this.shopId);
     // this.init()
@@ -2042,7 +2052,7 @@ export default {
   width: 100px;
   height: 100px;
 }
-.export  .img-item.checked {
+.export .img-item.checked {
   border-color: #409eff;
 }
 .export .checked-icon {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 724 - 611
src/views/shopManagement/shopsList.vue


+ 39 - 7
src/views/shopsList/merchIncome.vue

@@ -20,6 +20,7 @@
                     :show-file-list="false"
                     :on-success="handleAvatarSuccess"
                     :before-upload="beforeAvatarUpload"
+                    :headers="{ token: token }"
                   >
                     <img
                       v-if="logo"
@@ -69,6 +70,7 @@
                     :on-change="handleChange"
                     :on-remove="handleRemove"
                     :before-upload="beforeAvatarUpload"
+                    :headers="{ token: token }"
                   >
                     <i class="el-icon-plus"></i>
                   </el-upload>
@@ -730,7 +732,7 @@
           v-model="tixianData.zhiFuBaoName"
         >
         </el-input
-        >&nbsp;&nbsp
+        >&nbsp;&nbsp;
       </div>
       <div style="margin:10px 0;">
         <span>支付宝账号:</span>
@@ -756,6 +758,7 @@
             :show-file-list="false"
             :on-success="handleAvatarSuccess1"
             :before-upload="beforeAvatarUpload"
+            :headers="{ token: token }"
           >
             <img
               v-if="tixianData.cashQrCode"
@@ -1022,9 +1025,11 @@
   </el-tabs>
 </template>
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       size: 10,
       page: 1,
       id: "",
@@ -1098,7 +1103,7 @@ export default {
       putawayFlag: "",
       reservationOpenFlag: "",
       shopName: "",
-      mchId:'',
+      mchId: "",
       businessHours: "",
       lockHours: "",
       detailedAddress: "",
@@ -1274,7 +1279,7 @@ export default {
           shopId: shopId
         })
       }).then(({ data }) => {
-        console.log(data,'店铺信息');
+        console.log(data, "店铺信息");
 
         this.tableDataLoading = false;
         let returnData = data.data;
@@ -1365,7 +1370,7 @@ export default {
       this.img = this.imgs.join(",");
       var s = {
         shopName: this.shopName,
-        mchId:this.mchId,// 商户号
+        mchId: this.mchId, // 商户号
         businessHours: this.businessHours,
         lockHours: this.lockHours,
         detailedAddress: this.detailedAddress,
@@ -1393,7 +1398,7 @@ export default {
         method: "post",
         data: this.$http.adornData({
           shopName: this.shopName,
-          mchId:this.mchId,// 商户号
+          mchId: this.mchId, // 商户号
           businessHours: this.businessHours,
           lockHours: this.lockHours,
           detailedAddress: this.detailedAddress,
@@ -1455,6 +1460,8 @@ export default {
         this.tableDataLoading = false;
         let returnData = data.data;
         this.withdrawData = returnData;
+        console.log(this.withdrawData, "提现记录");
+
         for (var i in this.withdrawData.list) {
           if (this.withdrawData.list[i].address) {
             this.withdrawData.list[i].address = JSON.parse(
@@ -1583,6 +1590,8 @@ export default {
           shopId: this.shopId
         })
       }).then(({ data }) => {
+        console.log(data, "支付宝信息");
+
         this.tableDataLoading = false;
         let returnData = data.user.userEntity;
         this.tixianData = returnData;
@@ -1889,18 +1898,38 @@ export default {
     },
     // 缴纳保证金
     cashJiao(index) {
-      // this.shopId = this.$cookie.get('shopId')
+      this.shopId = this.$cookie.get("shopId");
       this.indexEr = index;
       if (index == 1) {
         this.shopQrImg =
           "https://mxys.chuanghai-tech.com/sqx_fast/invite/shopQr?shopId=" +
-          this.shopI;
+          this.$http.adornParams({
+            shopId: this.shopId
+          }).shopId;
+
+        // console.log(
+        //   this.$http.adornParams({
+        //     shopId: this.shopId
+        //   }).shopId
+        // );
+
+        // this.$http({
+        //   url: this.$http.adornUrl("invite/shopQr"),
+        //   method: "get",
+        //   params: this.$http.adornParams({
+        //     shopId: this.shopId
+        //   })
+        // }).then(({ data }) => {
+        //   console.log(data, "图片地址");
+        // });
       } else {
         this.$http({
           url: this.$http.adornUrl("app/common/type/334"),
           method: "get",
           params: this.$http.adornParams({})
         }).then(({ data }) => {
+          console.log(data, "图片地址");
+
           this.shopQrImg = data.data.value;
         });
       }
@@ -2055,6 +2084,9 @@ export default {
   },
   activated() {
     this.dataSelect();
+  },
+  mounted() {
+    this.token = Vue.cookie.get("token");
   }
 };
 </script>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1011 - 932
src/views/shopsList/shopWallet.vue


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2141 - 1738
src/views/shopsList/shopsList.vue


+ 325 - 290
src/views/sysmission/missionAdd.vue

@@ -1,290 +1,325 @@
-<template>
-  <div class="components-container main-cont">
-    <div style="position: relative;">
-		<span>任务标题:</span>
-		<el-input style="width: 200px;" placeholder="请输入任务标题" 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;" placeholder="请输入幸运值" 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="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload"
-				  :limit=1
-				  :on-success="handleUploadSuccess"
-				  list-type="picture-card"
-				  :on-remove="handleRemove"
-				  :on-change="handleChange"
-				>
-				<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"/>
-    </div>
-  </div>
-</template>
-
-<script>
-    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'
-
-    export default {
-        name: 'Tinymce',
-        data() {
-            return {
-                classifyId: '',
-                title: '',
-                luckyValue: '',
-				titlePicture:'',
-				isShow: false,
-				hideUpload: false,
-				limit:1,
-                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
-				}
-				this.$http({
-				  url: this.$http.adornUrl('helpTaskPlatform/saveHelpTaskPlatform'),
-				  method: 'post',
-				  data: this.$http.adornData({
-				    'title':this.title,
-				    'classifyId':this.classifyId,
-				    'content':this.content,
-				    'luckyValue':this.luckyValue,
-				    'titlePicture':this.titlePicture
-				  })
-				}).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()
-                })
-            },
-
-            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;
-
-                            if (xhr.status != 200) {
-                                failure('HTTP Error: ' + xhr.status);
-                                return;
-                            }
-                            json =JSON.parse(xhr.responseText);
-                            if (json == "" || json == null) {
-                                failure('Invalid JSON: ' + xhr.responseText);
-                                return;
-                            }
-                            success(json.data);
-                        };
-                        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()
-            }
-        },
-        deactivated() {
-            this.destroyTinymce()
-        }
-    }
-</script>
-
-<style>
-  .main-cont {
-    max-width: 100%;
-    min-width: 80%;
-	padding-bottom:5%;
-	background-color: #fff;
-  }
-
-  .tinymce-container {
-    position: relative;
-    line-height: normal;
-  }
-
-  .tinymce-container >>> .mce-fullscreen {
-    z-index: 10000;
-  }
-
-  .tinymce-textarea {
-    visibility: hidden;
-    z-index: -1;
-  }
- .hide .el-upload--picture-card {
-     display: none;
- }
-</style>
+<template>
+  <div class="components-container main-cont">
+    <div style="position: relative;">
+      <span>任务标题:</span>
+      <el-input
+        style="width: 200px;"
+        placeholder="请输入任务标题"
+        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;"
+        placeholder="请输入幸运值"
+        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"
+          :headers="{ token: token }"
+          :limit="1"
+          :on-success="handleUploadSuccess"
+          list-type="picture-card"
+          :on-remove="handleRemove"
+          :on-change="handleChange"
+        >
+          <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" />
+    </div>
+  </div>
+</template>
+
+<script>
+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";
+
+export default {
+  name: "Tinymce",
+  data() {
+    return {
+      token: "",
+      classifyId: "",
+      title: "",
+      luckyValue: "",
+      titlePicture: "",
+      isShow: false,
+      hideUpload: false,
+      limit: 1,
+      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;
+      }
+      this.$http({
+        url: this.$http.adornUrl("helpTaskPlatform/saveHelpTaskPlatform"),
+        method: "post",
+        data: this.$http.adornData({
+          title: this.title,
+          classifyId: this.classifyId,
+          content: this.content,
+          luckyValue: this.luckyValue,
+          titlePicture: this.titlePicture
+        })
+      }).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();
+      });
+    },
+
+    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", Vue.prototype.Tupiantou);
+          xhr.onload = function() {
+            var json;
+
+            if (xhr.status != 200) {
+              failure("HTTP Error: " + xhr.status);
+              return;
+            }
+            json = JSON.parse(xhr.responseText);
+            if (json == "" || json == null) {
+              failure("Invalid JSON: " + xhr.responseText);
+              return;
+            }
+            success(json.data);
+          };
+          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.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;
+}
+
+.tinymce-container {
+  position: relative;
+  line-height: normal;
+}
+
+.tinymce-container >>> .mce-fullscreen {
+  z-index: 10000;
+}
+
+.tinymce-textarea {
+  visibility: hidden;
+  z-index: -1;
+}
+.hide .el-upload--picture-card {
+  display: none;
+}
+</style>

+ 352 - 315
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="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload"
-				  :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>
-    </div>
-    <div class="tinymce-content">
-      <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'
-
-    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
-				})
-            },
-
-            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;
-
-                            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()
-            }
-        },
-        deactivated() {
-            this.destroyTinymce()
-        }
-    }
-</script>
-
-<style>
-  .main-cont {
-    max-width: 100%;
-    min-width: 80%;
-	padding-bottom:5%;
-	background-color: #fff;
-  }
-
-  .tinymce-container {
-    position: relative;
-    line-height: normal;
-  }
-
-  .tinymce-container >>> .mce-fullscreen {
-    z-index: 10000;
-  }
-
-  .tinymce-textarea {
-    visibility: hidden;
-    z-index: -1;
-  }
- .hide .el-upload--picture-card {
-     display: none;
- }
-</style>
+<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"
+          :headers="{ token: token }"
+          :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>
+    </div>
+    <div class="tinymce-content">
+      <textarea id="tinymceId" :value="content" class="tinymce-textarea" />
+    </div>
+  </div>
+</template>
+
+<script>
+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";
+
+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;
+
+          xhr = new XMLHttpRequest();
+          xhr.withCredentials = false;
+          xhr.open(
+            "POST",
+            Vue.prototype.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.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;
+}
+
+.tinymce-container {
+  position: relative;
+  line-height: normal;
+}
+
+.tinymce-container >>> .mce-fullscreen {
+  z-index: 10000;
+}
+
+.tinymce-textarea {
+  visibility: hidden;
+  z-index: -1;
+}
+.hide .el-upload--picture-card {
+  display: none;
+}
+</style>

+ 9 - 3
src/views/vueMchat/vueMchat.vue

@@ -268,6 +268,7 @@
                   :show-file-list="false"
                   :on-success="handleAvatarSuccess"
                   :before-upload="beforeAvatarUpload"
+                  :headers="{ token: token }"
                 >
                   <div class="icon-item" title="发送文件">
                     <img
@@ -302,9 +303,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       chatList: [],
       page: 1,
       size: 5,
@@ -367,9 +370,11 @@ export default {
   },
   methods: {
     initWebSocket() {
-      this.websock = new WebSocket(
-        "wss://mxys.chuanghai-tech.com/wss/ordersChat/" + this.orderId
-      );
+      // this.websock = new WebSocket(
+      //   "wss://mxys.chuanghai-tech.com/wss/ordersChat/" + this.orderId
+      // );
+      this.websock = new WebSocket(this.$http.adornWss(`ordersChat/${this.orderId}`));
+
       /* this.websock = new WebSocket(
           // this.$http.adornWss("ordersChat/0"));
         // "ws://192.168.0.119:8171/sqx_fast/websocket/0"); //这个连接ws://固定,后面的根据自己的IP和端口进行改变,我设置监听的就是8081*/
@@ -657,6 +662,7 @@ export default {
     }
   },
   mounted() {
+    this.token = Vue.cookie.get("token");
     this.quxiaoSocket();
     this.timer = window.setInterval(() => {
       setTimeout(() => {

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

@@ -208,6 +208,7 @@
                   :show-file-list="false"
                   :on-success="handleAvatarSuccess"
                   :before-upload="beforeAvatarUpload"
+             :headers="{ token: token }"
                 >
                   <div class="icon-item" title="发送文件">
                     <img
@@ -249,9 +250,11 @@
 </template>
 
 <script>
+import Vue from "vue";
 export default {
   data() {
     return {
+      token: "",
       chatList: [],
       page: 1,
       size: 5,
@@ -287,6 +290,7 @@ export default {
     };
   },
   created() {
+    this.token = Vue.cookie.get("token");
     this.loadEmojis();
   },
   watch: {