From 4a9e79bc9520fcfb4d8dac50a28c0957ecee3191 Mon Sep 17 00:00:00 2001 From: liuyx <1517482303@qq.com> Date: Sun, 18 Dec 2022 21:51:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E4=B8=8E=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E4=BF=A1=E6=81=AFapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog/src/api/article.js | 20 ++++++++++++++++++++ blog/src/api/site.js | 13 +++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 blog/src/api/article.js create mode 100644 blog/src/api/site.js diff --git a/blog/src/api/article.js b/blog/src/api/article.js new file mode 100644 index 0000000..132c6a9 --- /dev/null +++ b/blog/src/api/article.js @@ -0,0 +1,20 @@ +/* + * @Author: liuyx 1517482303@qq.com + * @Date: 2022-12-08 17:15:58 + * @LastEditTime: 2022-12-17 10:34:05 + * @Description: 文章相关API + */ +import request from '../utils/request' + +export const getArticleList = () => { + return request({ + url: '/articles' + }) +} + +// 根据id获取文章 +export const getArticleById = (id) => { + return request({ + url: `/articles/${id}` + }) +} diff --git a/blog/src/api/site.js b/blog/src/api/site.js new file mode 100644 index 0000000..a1182fb --- /dev/null +++ b/blog/src/api/site.js @@ -0,0 +1,13 @@ +/* + * @Author: liuyx 1517482303@qq.com + * @Date: 2022-12-17 10:33:16 + * @LastEditTime: 2022-12-17 10:39:50 + * @Description: 网站信息API + */ +import request from '../utils/request' + +export const getSiteInfo = () => { + return request({ + url: '/sites' + }) +}