From a44e1a40fddb503cddb16add6102baf7e69447e3 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Tue, 11 Jun 2024 09:34:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=8C=82=E8=BD=BD=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 4 +++- src/views/components/tinymce2/index.vue | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index a5f04b0b1..21707e886 100644 --- a/src/main.js +++ b/src/main.js @@ -12,6 +12,7 @@ import "@/assets/scss/aui.scss"; //按钮 import http from "@/utils/request"; +import { Message } from 'element-ui' // import renRadioGroup from "@/components/ren-radio-group"; // import renSelect from "@/components/ren-select"; // import renProcessMultiple from "@/components/ren-process-multiple"; @@ -33,6 +34,7 @@ import util from "@js/util"; // import Cookies from "js-cookie"; import getQueryPara from "dai-js/modules/getQueryPara"; + // 兼容token传参登录 if (getQueryPara("token")) { console.log("token", getQueryPara("token")); @@ -87,7 +89,7 @@ Vue.directive("fixed", { // 挂载全局 Vue.prototype.$http = http; - +Vue.prototype.$message = Message; // el-uploader的header配置 Vue.prototype.$getElUploadHeaders = () => ({ Authorization: localStorage.getItem("token") || "", diff --git a/src/views/components/tinymce2/index.vue b/src/views/components/tinymce2/index.vue index cac523ab4..96c30ea15 100644 --- a/src/views/components/tinymce2/index.vue +++ b/src/views/components/tinymce2/index.vue @@ -72,7 +72,7 @@ export default { let uploadUrl = window.SITE_CONFIG["apiURL"] + "/oss/file/upload-resi-event-file"; let token = this.getUserToken(); - + let that = this; let init = { selector: `#${this.id}`, language_url: require("./zh_CN.js"), // 中文语言包路径 @@ -115,6 +115,8 @@ export default { nonbreaking_force_tab: true, // 图片上传 images_upload_handler: function (blobInfo, succFun, failFun) { + console.log(that); + that.$message.warning('请上传小于10M的图片!') var xhr, formData; var file = blobInfo.blob(); // 转化为易于理解的file对象 if (file.size > 10 * 1024 * 1024) {