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 @@ +