From be2914146e28b12f361b606e22ac2ae2d2010a99 Mon Sep 17 00:00:00 2001 From: Double-_-Z <2492419643@qq.com> Date: Thu, 31 Oct 2024 17:11:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=96=87=E7=AB=A0=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/article/index.ts | 24 +++++ src/views/article/component/detail.vue | 28 +++++- src/views/article/component/upload.vue | 124 +++++++++++++++++++++---- vite.config.ts | 5 + 4 files changed, 161 insertions(+), 20 deletions(-) diff --git a/src/api/article/index.ts b/src/api/article/index.ts index 63657b6..d779dcb 100644 --- a/src/api/article/index.ts +++ b/src/api/article/index.ts @@ -11,6 +11,8 @@ import { baseUrlHost } from '../baseUrlHost'; * @method getLabelList 获取标签列表 * @method deleteArticle 删除文章 * @method getArticleDetail 获取文章详情 + * @method saveArticle 保存文章 + * @method updateArticle 更新文章 */ export function articleApi() { @@ -45,6 +47,28 @@ export function articleApi() { url: baseUrlHost + `/cpArticle/${id}`, method: 'get', }); + }, + saveArticle: (data: object) => { + return request({ + url: baseUrlHost + '/cpArticle', + method: 'post', + data, + }) + }, + updateArticle: (data: object) => { + return request({ + url: baseUrlHost + '/cpArticle', + method: 'put', + data, + }) + }, + uploadFile: (data: object) => { + return request({ + url: baseUrlHost + '/enAttachment/upload', + method: 'post', + data, + headers: { 'Content-Type': 'application/x-www-form-urlencoded'} + }) } }; } diff --git a/src/views/article/component/detail.vue b/src/views/article/component/detail.vue index 37e13c4..1244015 100644 --- a/src/views/article/component/detail.vue +++ b/src/views/article/component/detail.vue @@ -7,9 +7,9 @@ @@ -52,7 +52,15 @@ - + + +
+ + + 取消 + +
+
@@ -61,12 +69,16 @@