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' + }) +}