From b23367b873e681b4a38ad373f706a361fd87f51e Mon Sep 17 00:00:00 2001 From: liaoboping <2824044657@qq.com> Date: Mon, 15 Jul 2024 16:06:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E9=97=BB=E4=BF=A1=E6=81=AF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=B0=81=E9=9D=A2=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/.env.development | 4 +- ruoyi-ui/src/components/Editor/index.vue | 4 +- .../src/components/FragmentUpload/index.vue | 17 ++ .../components/ImageUploadLochost/index.vue | 213 ++++++------------ ruoyi-ui/src/main.js | 6 + .../src/views/official/slideshow/index.vue | 77 +++++-- ruoyi-ui/vue.config.js | 15 +- 7 files changed, 165 insertions(+), 171 deletions(-) create mode 100644 ruoyi-ui/src/components/FragmentUpload/index.vue diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development index f508238..4772195 100644 --- a/ruoyi-ui/.env.development +++ b/ruoyi-ui/.env.development @@ -5,7 +5,9 @@ VUE_APP_TITLE = 官网后台管理系统 ENV = 'development' # 若依管理系统/开发环境 -VUE_APP_BASE_API = '/dev-api' +VUE_APP_BASE_API = '/prod-api' +VUE_APP_API_TARGET_URL = 'http://47.121.27.78:8080/' +VUE_APP_IMAGE_PREVIEW_API = '/imagePreview/upload' # 应用访问路径 例如使用前缀 /admin/ VUE_APP_CONTEXT_PATH = '/' diff --git a/ruoyi-ui/src/components/Editor/index.vue b/ruoyi-ui/src/components/Editor/index.vue index 1f2e15e..430bcb6 100644 --- a/ruoyi-ui/src/components/Editor/index.vue +++ b/ruoyi-ui/src/components/Editor/index.vue @@ -60,7 +60,7 @@ export default { }, data() { return { - uploadUrl: process.env.VUE_APP_BASE_API + "/system/oss/upload", // 上传的图片服务器地址 + uploadUrl: process.env.VUE_APP_BASE_API + "/system/oss/addPartsUpload", // 上传的图片服务器地址 headers: { Authorization: "Bearer " + getToken() }, @@ -176,7 +176,7 @@ export default { // 获取光标所在位置 let length = quill.getSelection().index; // 插入图片 res.url为服务器返回的图片地址 - quill.insertEmbed(length, "image", res.data.url); + quill.insertEmbed(length, "image", this.$imagePreviewApi + '/' + res.data.url.split('/').pop()); // 调整光标到最后 quill.setSelection(length + 1); } else { diff --git a/ruoyi-ui/src/components/FragmentUpload/index.vue b/ruoyi-ui/src/components/FragmentUpload/index.vue new file mode 100644 index 0000000..efe70c9 --- /dev/null +++ b/ruoyi-ui/src/components/FragmentUpload/index.vue @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/components/ImageUploadLochost/index.vue b/ruoyi-ui/src/components/ImageUploadLochost/index.vue index 6c849b4..9d45d9c 100644 --- a/ruoyi-ui/src/components/ImageUploadLochost/index.vue +++ b/ruoyi-ui/src/components/ImageUploadLochost/index.vue @@ -1,21 +1,25 @@