diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 093277c..5b95bb1 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -6,7 +6,7 @@ "license": "MIT", "scripts": { "dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", - "build:prod": "vue-cli-service build", + "build:prod": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", "lint": "eslint --ext .js,.vue src" diff --git a/ruoyi-ui/src/components/Editor/index.vue b/ruoyi-ui/src/components/Editor/index.vue index 5e725b6..c3dde7f 100644 --- a/ruoyi-ui/src/components/Editor/index.vue +++ b/ruoyi-ui/src/components/Editor/index.vue @@ -213,7 +213,7 @@ export default { // 获取光标所在位置 let length = quill.getSelection().index; // 插入图片 res.url为服务器返回的图片地址 - quill.insertEmbed(length, "image", res.fileName); + quill.insertEmbed(length, "image", res.url); // 调整光标到最后 quill.setSelection(length + 1); } else { diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue index 2e64c9b..ad15889 100644 --- a/ruoyi-ui/src/components/ImageUpload/index.vue +++ b/ruoyi-ui/src/components/ImageUpload/index.vue @@ -76,7 +76,7 @@ export default { dialogImageUrl: "", dialogVisible: false, hideUpload: false, - baseUrl: process.env.VUE_APP_BASE_API, + baseUrl: '',//process.env.VUE_APP_BASE_API, uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 headers: { Authorization: "Bearer " + getToken(), @@ -87,12 +87,15 @@ export default { watch: { value: { handler(val) { + console.log(val) if (val) { // 首先将值转为数组 const list = Array.isArray(val) ? val : this.value.split(','); // 然后将数组转为对象数组 this.fileList = list.map(item => { + console.log(item) if (typeof item === "string") { + if (item.indexOf(this.baseUrl) === -1) { item = { name: this.baseUrl + item, url: this.baseUrl + item }; } else { @@ -155,7 +158,7 @@ export default { // 上传成功回调 handleUploadSuccess(res, file) { if (res.code === 200) { - this.uploadList.push({ name: res.fileName, url: res.fileName }); + this.uploadList.push({ name: res.fileName, url: res.url }); this.uploadedSuccessfully(); } else { this.number--; diff --git a/ruoyi-ui/src/views/system/article/index.vue b/ruoyi-ui/src/views/system/article/index.vue index da8b54c..cdd0bee 100644 --- a/ruoyi-ui/src/views/system/article/index.vue +++ b/ruoyi-ui/src/views/system/article/index.vue @@ -87,6 +87,15 @@ :label="item.tagName" :value="item.tagId"> + + + +