diff --git a/src/api/system/user.js b/src/api/system/user.js index c7b67a2..5cd50b2 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -1,5 +1,5 @@ import request from '@/utils/request' -import { parseStrEmpty } from "@/utils/xinelu"; +import { parseStrEmpty } from "@/utils/xinyilu"; // 查询用户列表 export function listUser(query) { diff --git a/src/assets/images/profile.jpg b/src/assets/images/profile.jpg index b3a940b..f8d8525 100644 Binary files a/src/assets/images/profile.jpg and b/src/assets/images/profile.jpg differ diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 6bb5a18..616fa47 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -9,10 +9,10 @@ :show-file-list="false" :headers="headers" style="display: none" + :data="filetype" ref="upload" v-if="this.type == 'url'" - > - + >
@@ -56,13 +56,21 @@ export default { type: { type: String, default: "url", - } + }, + url: { + type: String, + default: "/common/richTextPictureUrl", + }, + // filetypes: { + // type: String, + // default: "", + // }, }, data() { return { - uploadUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 + uploadUrl: process.env.VUE_APP_BASE_API, // 上传的图片服务器地址 headers: { - Authorization: "Bearer " + getToken() + Authorization: "Bearer " + getToken(), }, Quill: null, currentValue: "", @@ -73,23 +81,31 @@ export default { modules: { // 工具栏配置 toolbar: [ - ["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线 - ["blockquote", "code-block"], // 引用 代码块 - [{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表 - [{ indent: "-1" }, { indent: "+1" }], // 缩进 - [{ size: ["small", false, "large", "huge"] }], // 字体大小 - [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题 - [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色 - [{ align: [] }], // 对齐方式 - ["clean"], // 清除文本格式 - ["link", "image", "video"] // 链接、图片、视频 + ["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线 + ["blockquote", "code-block"], // 引用 代码块 + [{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表 + [{ indent: "-1" }, { indent: "+1" }], // 缩进 + [{ size: ["small", false, "large", "huge"] }], // 字体大小 + [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题 + [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色 + [{ align: [] }], // 对齐方式 + ["clean"], // 清除文本格式 + ["link", "image"], // 链接、图片、视频 ], }, placeholder: "请输入内容", readOnly: this.readOnly, }, + filetype: { + type: "", + }, }; }, + created() { + this.uploadUrl = process.env.VUE_APP_BASE_API + this.url; + // console.log(this.url) + // this.filetype.type = this.filetypes; + }, computed: { styles() { let style = {}; @@ -126,7 +142,7 @@ export default { const editor = this.$refs.editor; this.Quill = new Quill(editor, this.options); // 如果设置了上传地址则自定义图片上传事件 - if (this.type == 'url') { + if (this.type == "url") { let toolbar = this.Quill.getModule("toolbar"); toolbar.addHandler("image", (value) => { this.uploadType = "image"; @@ -176,7 +192,13 @@ export default { // 获取光标所在位置 let length = quill.getSelection().index; // 插入图片 res.url为服务器返回的图片地址 - quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName); + quill.insertEmbed( + length, + "image", + process.env.VUE_APP_BASE_API + res.fileName + ); + console.log(res); + this.$emit("imgs", res.fileName); // 调整光标到最后 quill.setSelection(length + 1); } else { @@ -191,7 +213,8 @@ export default { diff --git a/src/views/login.vue b/src/views/login.vue index a5521a1..22a42e6 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -1,15 +1,25 @@
+