diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png index c23e06e..0ba7d57 100644 Binary files a/src/assets/images/logo.png and b/src/assets/images/logo.png differ diff --git a/src/assets/images/logo1.png b/src/assets/images/logo1.png index 96be788..c24744c 100644 Binary files a/src/assets/images/logo1.png and b/src/assets/images/logo1.png differ diff --git a/src/components/editor.js b/src/components/editor.js index 600f01c..63236ef 100644 --- a/src/components/editor.js +++ b/src/components/editor.js @@ -1,7 +1,5 @@ -import Axios from 'axios' -import Api from '@/api' -import Setting from '@/setting' -import Util from '@/libs/util' +import Oss from '@/components/upload/upload.js' +import { Loading } from 'element-ui' export default { //skin:'oxide-dark', language:'zh_CN', @@ -312,21 +310,25 @@ export default { powerpaste_allow_local_images: true, powerpaste_word_import: 'clean', powerpaste_html_import: 'clean', + urlconverter_callback: (url, node, onSave, name) => { + if (node === 'img' && url.startsWith('blob:')) { + // Do some custom URL conversion + tinymce.activeEditor && tinymce.activeEditor.uploadImages() + } + // Return new URL + return url + }, // 自定义上传 images_upload_handler: function (blobInfo, succFun, failFun) { - const form = new FormData() - form.append('file', blobInfo.blob()), - Axios({ - method: 'post', - url: Api.upload, - data: form, - headers: { - 'Content-Type': 'multipart/form-data', - token: Util.local.get(Setting.tokenKey) - }, - }).then(({ data }) => { - succFun(data.url) - }).catch(res => {}) + const blob = blobInfo.blob() + // blob转换为file + const file = new File([blob], blobInfo.filename(), { + type: 'application/json', + lastModified: Date.now() + }); + Oss.upload(file).then(res => { + succFun(res.url) + }) }, //自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发 file_picker_callback: function (callback, value, meta) { @@ -344,19 +346,13 @@ export default { input.setAttribute("accept", ".mp4"); input.onchange = function(){ let file = this.files[0]; - let fd = new FormData(); - fd.append("file", file); - Axios({ - method: 'post', - url: Api.upload, - data: fd, - headers: { - 'Content-Type': 'multipart/form-data', - token: Util.local.get(Setting.tokenKey) - }, - }).then(({ data }) => { - callback(data.url) - }).catch(res => {}) + const load = Loading.service() + Oss.upload(file).then(res => { + load.close() + callback(res.url) + }).catch(e => { + load.close() + }) } //触发点击 input.click(); diff --git a/src/layouts/navbar/index.vue b/src/layouts/navbar/index.vue index 9f01c1d..576a11a 100644 --- a/src/layouts/navbar/index.vue +++ b/src/layouts/navbar/index.vue @@ -5,7 +5,7 @@ - 网站管理后台 + 运营管理后台 - 网站管理后台 + 运营管理后台
@@ -38,11 +38,6 @@ type="primary" @click="submit">登录
-
- - 回到官网 -