From 51ef94166c5df6758c361149c5e2977e80242e52 Mon Sep 17 00:00:00 2001 From: haitao <1622138424@qq.com> Date: Sat, 7 Oct 2023 11:32:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E8=AE=A2=E9=98=85=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=EF=BC=8C=E6=9C=AC=E5=9C=B0=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 + public/index.html | 2 +- src/components/admin/postEdit.vue | 38 +- src/components/admin/resourceList.vue | 20 +- src/components/admin/resourcePathList.vue | 2 +- src/components/article.vue | 455 ++++++++++++++-------- src/components/comment/graffiti.vue | 35 +- src/components/common/uploadPicture.vue | 68 ++-- src/components/friend.vue | 50 ++- src/components/home.vue | 3 +- src/components/myAside.vue | 66 ++-- src/utils/common.js | 5 +- src/utils/request.js | 6 +- 13 files changed, 509 insertions(+), 249 deletions(-) diff --git a/README.md b/README.md index 19b3edf..13e90ea 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,12 @@ - 优化:文件上传模块改造,每次上传之前获取上传密钥,每个密钥只能上传一个文件 - 优化:个别Bug修复 +### 2023年10月1日更新 +- 新增:文章加密 +- 新增:文章订阅 +- 新增:文件上传模块改造,支持多平台(目前对接本地) +- 优化:友人帐及其他模块样式调整 + ### 首页 ![首页](首页.jpg) @@ -110,6 +116,8 @@ npm run build 一定要`Star` +注意:[poetize.cn](https://poetize.cn)可能会下线,也可能不会,看缘分吧。 + ## 欢迎进群(一定要Star) 1. 交流(摸鱼) 2. 安装部署:互相帮助,争取每个人都零基础拥有自己的个人网站 diff --git a/public/index.html b/public/index.html index e9bf75b..5ed96d7 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ - Sara + Poetize diff --git a/src/components/admin/postEdit.vue b/src/components/admin/postEdit.vue index be25158..1094aca 100644 --- a/src/components/admin/postEdit.vue +++ b/src/components/admin/postEdit.vue @@ -53,6 +53,10 @@ + + + +
@@ -112,6 +116,7 @@ recommendStatus: false, viewStatus: true, password: "", + tips: "", articleCover: "", sortId: null, labelId: null @@ -176,11 +181,39 @@ suffix = file.name.substring(file.name.lastIndexOf('.')); } let key = "articlePicture" + "/" + this.$store.state.currentAdmin.username.replace(/[^a-zA-Z]/g, '') + this.$store.state.currentAdmin.id + new Date().getTime() + Math.floor(Math.random() * 1000) + suffix; + + let storeType = localStorage.getItem("defaultStoreType"); + let fd = new FormData(); fd.append("file", file); fd.append("key", key); + fd.append("relativePath", key); + fd.append("type", "articlePicture"); + fd.append("storeType", storeType); - this.$http.get(this.$constant.baseURL + "/qiniu/getUpToken", {key: key}, true) + if (storeType === "local") { + this.saveLocal(pos, fd); + } else if (storeType === "qiniu") { + this.saveQiniu(pos, fd); + } + }, + saveLocal(pos, fd) { + this.$http.upload(this.$constant.baseURL + "/resource/upload", fd, true) + .then((res) => { + if (!this.$common.isEmpty(res.data)) { + let url = res.data; + this.$refs.md.$img2Url(pos, url); + } + }) + .catch((error) => { + this.$message({ + message: error.message, + type: "error" + }); + }); + }, + saveQiniu(pos, fd) { + this.$http.get(this.$constant.baseURL + "/qiniu/getUpToken", {key: fd.get("key")}, true) .then((res) => { if (!this.$common.isEmpty(res.data)) { fd.append("token", res.data); @@ -189,7 +222,8 @@ .then((res) => { if (!this.$common.isEmpty(res.key)) { let url = this.$constant.qiniuDownload + res.key; - this.$common.saveResource(this, "articlePicture", url, file.size, file.type, true); + let file = fd.get("file"); + this.$common.saveResource(this, "articlePicture", url, file.size, file.type, "qiniu", true); this.$refs.md.$img2Url(pos, url); } }) diff --git a/src/components/admin/resourceList.vue b/src/components/admin/resourceList.vue index 4d59382..7f3544e 100644 --- a/src/components/admin/resourceList.vue +++ b/src/components/admin/resourceList.vue @@ -58,6 +58,7 @@ +