From 19c4e12a5b0b095c5818cda0a5eccc2ff1d27c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= <1431128779@qq.com> Date: Sun, 2 Jun 2024 18:46:36 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=88=A0=E9=99=A4=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/admin/attachment.js | 86 --- api/admin/category.js | 70 -- api/admin/comments.js | 142 ---- api/admin/journal.js | 61 -- api/admin/links.js | 59 -- api/admin/logs.js | 28 - api/admin/photos.js | 101 --- api/admin/posts.js | 122 ---- api/admin/tags.js | 56 -- api/admin/user.js | 83 --- api/archive.js | 22 - api/article.js | 22 - api/blogger.js | 15 - api/category.js | 36 - api/comment.js | 45 -- api/index.js | 59 +- api/journal.js | 74 -- api/link.js | 24 - api/login.js | 112 --- api/menu.js | 24 - api/option.js | 30 - api/photo.js | 31 - api/post.js | 90 --- api/sheet.js | 67 -- api/statistics.js | 22 - api/tag.js | 24 - api/theme.js | 40 -- api/url.js | 1 - pages.json | 289 -------- pagesA/article-detail/article-detail.vue | 2 +- pagesA/category-detail/category-detail.vue | 2 +- pagesB/admin/admin.vue | 285 -------- pagesB/articles/article-edit.vue | 689 ------------------- pagesB/articles/article-setting.vue | 763 --------------------- pagesB/articles/articles.vue | 414 ----------- pagesB/attachment/attachment.vue | 751 -------------------- pagesB/category/category.vue | 395 ----------- pagesB/comments/comments.vue | 472 ------------- pagesB/journal/journal-edit.vue | 620 ----------------- pagesB/journal/journal.vue | 171 ----- pagesB/links/links.vue | 415 ----------- pagesB/login/login.vue | 185 ----- pagesB/logs/logs.vue | 309 --------- pagesB/menus/menus.vue | 30 - pagesB/password/password.vue | 146 ---- pagesB/photos/photos-edit.vue | 19 - pagesB/photos/photos.vue | 476 ------------- pagesB/profile/profile.vue | 249 ------- pagesB/settings/settings.vue | 30 - pagesB/tags/tags.vue | 371 ---------- pagesB/template.vue | 93 --- router/router.js | 64 +- store/article.js | 27 - store/auth.js | 39 +- store/blogger.js | 3 +- store/journal.js | 27 - store/user.js | 31 +- 57 files changed, 17 insertions(+), 8896 deletions(-) delete mode 100644 api/admin/attachment.js delete mode 100644 api/admin/category.js delete mode 100644 api/admin/comments.js delete mode 100644 api/admin/journal.js delete mode 100644 api/admin/links.js delete mode 100644 api/admin/logs.js delete mode 100644 api/admin/photos.js delete mode 100644 api/admin/posts.js delete mode 100644 api/admin/tags.js delete mode 100644 api/admin/user.js delete mode 100644 api/archive.js delete mode 100644 api/article.js delete mode 100644 api/blogger.js delete mode 100644 api/category.js delete mode 100644 api/comment.js delete mode 100644 api/journal.js delete mode 100644 api/link.js delete mode 100644 api/login.js delete mode 100644 api/menu.js delete mode 100644 api/option.js delete mode 100644 api/photo.js delete mode 100644 api/post.js delete mode 100644 api/sheet.js delete mode 100644 api/statistics.js delete mode 100644 api/tag.js delete mode 100644 api/theme.js delete mode 100644 api/url.js delete mode 100644 pagesB/admin/admin.vue delete mode 100644 pagesB/articles/article-edit.vue delete mode 100644 pagesB/articles/article-setting.vue delete mode 100644 pagesB/articles/articles.vue delete mode 100644 pagesB/attachment/attachment.vue delete mode 100644 pagesB/category/category.vue delete mode 100644 pagesB/comments/comments.vue delete mode 100644 pagesB/journal/journal-edit.vue delete mode 100644 pagesB/journal/journal.vue delete mode 100644 pagesB/links/links.vue delete mode 100644 pagesB/login/login.vue delete mode 100644 pagesB/logs/logs.vue delete mode 100644 pagesB/menus/menus.vue delete mode 100644 pagesB/password/password.vue delete mode 100644 pagesB/photos/photos-edit.vue delete mode 100644 pagesB/photos/photos.vue delete mode 100644 pagesB/profile/profile.vue delete mode 100644 pagesB/settings/settings.vue delete mode 100644 pagesB/tags/tags.vue delete mode 100644 pagesB/template.vue delete mode 100644 store/article.js delete mode 100644 store/journal.js diff --git a/api/admin/attachment.js b/api/admin/attachment.js deleted file mode 100644 index cb56234..0000000 --- a/api/admin/attachment.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * 附件管理 - * @see https://api.halo.run/admin-api.html#tag/attachment-controller - */ -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 分页获取附件列表 - * { - * "attachmentType": "ALIOSS" "BAIDUBOS" "HUAWEIOBS" "LOCAL" "MINIO" "QINIUOSS" "SMMS" "TENCENTCOS" "UPOSS", - * "keyword": "string" - * "mediaType": "string" - * "page": "string" - * "size": "string" - * "sort": "string" - * } - */ - getAttachmentsByPage: (params) => { - return HttpHandler.Get('/api/admin/attachments', params, {}) - }, - - /** - * 获取所有的附件类型 - */ - getAttachmentsMediaTypes: () => { - return HttpHandler.Get('/api/admin/attachments/media_types') - }, - - /** - * 根据附件类型获取所有的附件列表 - */ - getAttachmentsTypes: () => { - return HttpHandler.Get('/api/admin/attachments/types') - }, - - /** - * 根据附件Id获取附件详情 - */ - getAttachmentsById: (attachmentId) => { - return HttpHandler.Get(`/api/admin/attachments/${attachmentId}`) - }, - - /** - * 上传附件-单文件(file) - * { - * file:文件对象 - * } - */ - uploadAttachment: (data) => { - return HttpHandler.Upload(`/api/admin/attachments/upload`, data) - }, - - /** - * 上传附件-多文件(files) - * { - * files:文件对象集合 - * } - */ - uploadAttachments: (data) => { - return HttpHandler.Upload(`/api/admin/attachments/uploads`, data) - }, - - /** - * 修改一个附件信息 - */ - updateAttachmentById: (attachmentId, name) => { - return HttpHandler.Put(`/api/admin/attachments/${attachmentId}`, { - name: name - }) - }, - - /** - * 批量删除附件(id集合) - */ - deleteAttachmentByIds: (attachmentIds = []) => { - return HttpHandler.Delete(`/api/admin/attachments`, attachmentIds) - }, - - /** - * 删除单个附件 - */ - deleteAttachmentById: (attachmentId) => { - return HttpHandler.Delete(`/api/admin/attachments/${attachmentId}`) - }, -} diff --git a/api/admin/category.js b/api/admin/category.js deleted file mode 100644 index 957ef9c..0000000 --- a/api/admin/category.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * 文章分类管理 - * @see https://api.halo.run/admin-api.html#tag/category-controller - */ -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 查询所有的文章分类 - * { - * "sort": ["",""], // 排序 - * "more": "Boolean" ,// 更多参数(回调) - * } - */ - getCategoryList: (params) => { - return HttpHandler.Get('/api/admin/categories', params) - }, - - /** - * 查询所有的文章分类(树形数据) - * { - * "sort": ["",""], // 排序 - * } - */ - getCategoryListTree: (params) => { - return HttpHandler.Get('/api/admin/categories/tree_view', params) - }, - - /** - * 查询文章分类详情 - * @param {Number} categoryId 分类ID - */ - getCategoryDetail: (categoryId) => { - return HttpHandler.Get(`/api/admin/categories/${categoryId}`) - }, - - /** - * 新增文章分类 - * { - * "description": "string", - * "id": 0, - * "name": "string", - * "parentId": 0, - * "password": "string", - * "priority": 0, - * "slug": "string", - * "thumbnail": "string" - * } - */ - createCategory: (data) => { - return HttpHandler.Post(`/api/admin/categories`, data) - }, - - /** - * 修改文章分类信息 - * @param {Number} categoryId 分类id - * @param {Object} data 同新增 - */ - updateCategoryById: (categoryId, data) => { - return HttpHandler.Put(`/api/admin/categories/${categoryId}`, data) - }, - - /** - * 删除单个文章分类 - * @param {Number} categoryId 文章分类id - */ - deleteCategoryById: (categoryId) => { - return HttpHandler.Delete(`/api/admin/categories/${categoryId}`) - }, -} diff --git a/api/admin/comments.js b/api/admin/comments.js deleted file mode 100644 index 845bd1f..0000000 --- a/api/admin/comments.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * 文章评论管理 - * @see https://api.halo.run/admin-api.html#tag/journal-controller - */ -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 查询文章评论 - * { - * "keyword":"", // 关键字 - * "page": 0, // 分页索引 - * "size": 10, // 分页大小 - * "sort": ["",""], // 排序 - * "status": "" , // 类型 "AUDITING" "PUBLISHED" "RECYCLE" - * } - */ - getPostsComments: (params) => { - return HttpHandler.Get('/api/admin/posts/comments', params) - }, - - /** - * 回复文章评论 - * { - * "allowNotification": true, - * "author": "string", - * "authorUrl": "string", - * "content": "string", - * "email": "string", - * "parentId": 0, - * "postId": 0 - * } - */ - postPostsComments: (data) => { - return HttpHandler.Post('/api/admin/posts/comments', data) - }, - /** - * 更新文章评论状态 - * @param {Number} commentId id - * @param {String} status "AUDITING" "PUBLISHED" "RECYCLE" - */ - updatePostsCommentsStatus: (commentId, status) => { - return HttpHandler.Put(`/api/admin/posts/comments/${commentId}/status/${status}`) - }, - /** - * 删除文章评论 - * @param {Number} commentId id - */ - deletePostsCommentsById: (commentId) => { - return HttpHandler.Delete(`/api/admin/posts/comments/${commentId}`) - }, - - /** - * 查询页面评论 - * { - * "keyword":"", // 关键字 - * "page": 0, // 分页索引 - * "size": 10, // 分页大小 - * "sort": ["",""], // 排序 - * "status": "" , // 类型 "AUDITING" "PUBLISHED" "RECYCLE" - * } - */ - getSheetsComments: (params) => { - return HttpHandler.Get('/api/admin/sheets/comments', params) - }, - - /** - * 回复页面评论 - * { - * "allowNotification": true, - * "author": "string", - * "authorUrl": "string", - * "content": "string", - * "email": "string", - * "parentId": 0, - * "postId": 0 - * } - */ - postSheetsComments: (data) => { - return HttpHandler.Post('/api/admin/sheets/comments', data) - }, - /** - * 更新页面评论状态 - * @param {Number} commentId id - * @param {String} status "AUDITING" "PUBLISHED" "RECYCLE" - */ - updateSheetsCommentsStatus: (commentId, status) => { - return HttpHandler.Put(`/api/admin/sheets/comments/${commentId}/status/${status}`) - }, - /** - * 删除页面评论 - * @param {Number} commentId id - */ - deleteSheetsCommentsById: (commentId) => { - return HttpHandler.Delete(`/api/admin/sheets/comments/${commentId}`) - }, - - /** - * 查询日记评论 - * { - * "keyword":"", // 关键字 - * "page": 0, // 分页索引 - * "size": 10, // 分页大小 - * "sort": ["",""], // 排序 - * "status": "" , // 类型 "AUDITING" "PUBLISHED" "RECYCLE" - * } - */ - getJournalsComments: (params) => { - return HttpHandler.Get('/api/admin/journals/comments', params) - }, - - /** - * 回复日记评论 - * { - * "allowNotification": true, - * "author": "string", - * "authorUrl": "string", - * "content": "string", - * "email": "string", - * "parentId": 0, - * "postId": 0 - * } - */ - postJournalsComments: (data) => { - return HttpHandler.Post('/api/admin/journals/comments', data) - }, - /** - * 更新日记评论状态 - * @param {Number} commentId id - * @param {String} status "AUDITING" "PUBLISHED" "RECYCLE" - */ - updateJournalsCommentsStatus: (commentId, status) => { - return HttpHandler.Put(`/api/admin/journals/comments/${commentId}/status/${status}`) - }, - /** - * 删除日记评论 - * @param {Number} commentId id - */ - deleteJournalsCommentsById: (commentId) => { - return HttpHandler.Delete(`/api/admin/journals/comments/${commentId}`) - }, -} diff --git a/api/admin/journal.js b/api/admin/journal.js deleted file mode 100644 index 0b6acab..0000000 --- a/api/admin/journal.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * 个人日记管理 - * @see https://api.halo.run/admin-api.html#tag/journal-controller - */ -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 查询所有的日记列表 - * { - * "keyword":"", // 关键字 - * "page": 0, // 分页索引 - * "size": 10, // 分页大小 - * "sort": ["",""], // 排序 - * "type": "" , // 类型 "INTIMATE" "PUBLIC" - * } - */ - getJournals: (params) => { - return HttpHandler.Get('/api/admin/journals', params) - }, - - /** - * 查询最近的所有的日记列表 - * { - * "top":number, // 数量 - * } - */ - getLatestJournals: (params) => { - return HttpHandler.Get('/api/admin/journals/latest', params) - }, - - /** - * 新增个人日记 - * { - * "content": "string", - * "keepRaw": true, - * "sourceContent": "string", - * "type": "INTIMATE", - * } - */ - createJournals: (data) => { - return HttpHandler.Post(`/api/admin/journals`, data) - }, - - /** - * 修改个人日记信息 - * @param {Number} journalsId id - * @param {Object} data 同新增 - */ - updateJournalsById: (journalsId, data) => { - return HttpHandler.Put(`/api/admin/journals/${journalsId}`, data) - }, - - /** - * 删除个人日记 - * @param {Number} journalsId id - */ - deleteJournalsById: (journalsId) => { - return HttpHandler.Delete(`/api/admin/journals/${journalsId}`) - }, -} diff --git a/api/admin/links.js b/api/admin/links.js deleted file mode 100644 index a0cc4bc..0000000 --- a/api/admin/links.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 友链管理 - * @see https://api.halo.run/admin-api.html#tag/link-controller - */ -import HttpHandler from '@/common/http/request.js' - -export default { - // 获取友链列表 - getLinkList: () => { - return HttpHandler.Get('/api/admin/links') - }, - /** - * 获取友链详情 - * @params { Number } linkId 友链Id - */ - getLinkDetail: (linkId) => { - return HttpHandler.Get(`/api/admin/links/${linkId}`) - }, - /** - * 新增友链 - * { - * "description": "string", - * "logo": "string", - * "name": "string", - * "priority": 0, - * "team": "string", - * "url": "string" - * } - */ - addLink: (data) => { - return HttpHandler.Post('/api/admin/links', data, {}) - }, - /** - * 修改友链 - * { - * "description": "string", - * "logo": "string", - * "name": "string", - * "priority": 0, - * "team": "string", - * "url": "string" - * } - */ - updateLink: (linkId, data) => { - return HttpHandler.Put(`/api/admin/links/${linkId}`, data, {}) - }, - /** - * 删除友链 - * @params { Number } linkId 友链Id - */ - deleteLink: (linkId) => { - return HttpHandler.Delete(`/api/admin/links/${linkId}`) - }, - - // 获取友链分组 - getLinkTeamList: (data) => { - return HttpHandler.Get('/api/admin/links/teams') - }, -} diff --git a/api/admin/logs.js b/api/admin/logs.js deleted file mode 100644 index 8232b2d..0000000 --- a/api/admin/logs.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 日志管理 - * @see https://api.halo.run/admin-api.html#tag/link-controller - */ -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取日志列表列表 - * params:{ top: Number} - */ - getLogsLatestList: (params) => { - return HttpHandler.Get('/api/admin/logs/latest', params) - }, - /** - * 获取日志列表列表 - * params:{ page:Number,size:Number, sort:String } - */ - getLogsListByPage: (params) => { - return HttpHandler.Get('/api/admin/logs', params) - }, - /** - * 清空日志 - */ - deleteAllLogs: () => { - return HttpHandler.Get(`/api/admin/logs/clear`) - }, -} diff --git a/api/admin/photos.js b/api/admin/photos.js deleted file mode 100644 index 7a861c4..0000000 --- a/api/admin/photos.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * 图库管理 - * @see https://api.halo.run/admin-api.html#tag/photo-controller - */ -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 查询图片列表 - * { - * "sort": ["",""], // 排序 - * "more": "Boolean" ,// 更多参数(回调) - * } - */ - getPhotos: (params) => { - return HttpHandler.Get('/api/admin/photos', params) - }, - - /** - * 查询最近的图库列表(树形数据) - * { - * "sort": ["",""], // 排序 - * } - */ - getLatestPhotos: (params) => { - return HttpHandler.Get('/api/admin/photos/latest', params) - }, - - /** - * 查询所有的图片分组 - */ - getPhotosTeams: () => { - return HttpHandler.Get('/api/admin/photos/teams') - }, - - /** - * 查询图片详情 - * @param {Number} photoId id - */ - getPhotosDetail: (photoId) => { - return HttpHandler.Get(`/api/admin/photos/${photoId}`) - }, - - /** - * 新增图片(单图) - *{ - * "description": "string", - * "id": 0, - * "location": "string", - * "name": "string", - * "takeTime": "2019-08-24T14:15:22Z", - * "team": "string", - * "thumbnail": "string", - * "url": "string" - *} - */ - createPhotos: (data) => { - return HttpHandler.Post(`/api/admin/photos`, data) - }, - - /** - * 新增图片(批量) - * { - * "description": "string", - * "id": 0, - * "location": "string", - * "name": "string", - * "takeTime": "2019-08-24T14:15:22Z", - * "team": "string", - * "thumbnail": "string", - * "url": "string" - * } - */ - createPhotosBatch: (data) => { - return HttpHandler.Post(`/api/admin/photos/batch`, data) - }, - - /** - * 修改图片信息 - * @param {Number} photoId id - * @param {Object} data 同新增 - */ - updatePhotosById: (photoId, data) => { - return HttpHandler.Put(`/api/admin/photos/${photoId}`, data) - }, - - /** - * 删除单张图片 - * @param {Number} photoId id - */ - deletePhotosById: (photoId) => { - return HttpHandler.Delete(`/api/admin/photos/${photoId}`) - }, - /** - * 批量删除图片 - * @param {Number} photoIds id数组 - */ - deletePhotosBatchById: (photoIds) => { - return HttpHandler.Delete(`/api/admin/photos/batch`, photoIds) - }, -} diff --git a/api/admin/posts.js b/api/admin/posts.js deleted file mode 100644 index a9d6023..0000000 --- a/api/admin/posts.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * 文章管理 - * @see https://api.halo.run/admin-api.html#tag/post-controller - */ -import HttpHandler from '@/common/http/request.js' - -/** - * 新建和编辑文章字段 - */ -const createOrEditModel = { - "categoryIds": [ - 0 - ], - "content": "string", - "createTime": "2019-08-24T14:15:22Z", - "disallowComment": true, - "editorType": "MARKDOWN", - "keepRaw": true, - "metaDescription": "string", - "metaKeywords": "string", - "metas": [{ - "key": "string", - "postId": 0, - "value": "string" - }], - "originalContent": "string", - "formatContent": "", - "password": "string", - "slug": "string", - "status": "DRAFT", - "summary": "string", - "tagIds": [ - 0 - ], - "template": "string", - "thumbnail": "string", - "title": "string", - "topPriority": 0 -} - - -export default { - /** - * 查询文章列表 - * @param {Object} params { - * categoryId,keyword,page,size,sort, - * status:"DRAFT" "INTIMATE" "PUBLISHED" "RECYCLE",statuses,more - * } - */ - getPostsByPage: (params) => { - return HttpHandler.Get('/api/admin/posts', params) - }, - - /** - * 查询最近的文章列表 - * @param {Object} params {top:Number} - */ - getLatestPosts: (params) => { - return HttpHandler.Get('/api/admin/posts/latest', params) - }, - /** - * 根据状态查询文章列表 - * @param {String} status:"DRAFT" "INTIMATE" "PUBLISHED" "RECYCLE" - * @param {Object} params:{ page,size,sort,more } - */ - getPostsPageByStatus: (status, params) => { - return HttpHandler.Get(`/api/admin/posts/status/${status}`, params) - }, - - /** - * 根据文章id获取文章 - * @param {Number} postsId 文章id - */ - getPostsById: (postsId) => { - return HttpHandler.Get(`/api/admin/posts/${postsId}`) - }, - - /** - * 新增文章 - * @param {Object} data 同新增 - * @param {Boolean} isAutoSave 是否来源于自动保存 - */ - createPosts: (data, isAutoSave = false) => { - return HttpHandler.Post(`/api/admin/posts?autoSave=${isAutoSave}`, data) - }, - - /** - * 修改文章 - * @param {Number} postsId id - * @param {Object} data 同新增 - * @param {Boolean} isAutoSave 是否来源于自动保存 - */ - updatePostsById: (postsId, data, isAutoSave = false) => { - return HttpHandler.Put(`/api/admin/posts/${postsId}?autoSave=${isAutoSave}`, data) - }, - - /** - * 修改文章(草稿) - * @param {Number} postsId id - * @param {Object} data { content,keepRaw,originalContent } - */ - updatePostsDraftById: (postsId, data) => { - return HttpHandler.Put(`/api/admin/posts/${postsId}/status/draft/content`, data) - }, - - /** - * 修改文章状态 - * @param {Number} postsId id - * @param {String} status "DRAFT" "INTIMATE" "PUBLISHED" "RECYCLE" - */ - updatePostsDraftById: (postsId, status) => { - return HttpHandler.Put(`/api/admin/posts/${postsId}/status/${status}`) - }, - - /** - * 删除文章(批量) - * @param {Array} postsIds ids - */ - deletePostsByIds: (postsIds) => { - return HttpHandler.Delete(`/api/admin/posts`, postsIds) - }, -} diff --git a/api/admin/tags.js b/api/admin/tags.js deleted file mode 100644 index 221f429..0000000 --- a/api/admin/tags.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 标签管理 - * @see https://api.halo.run/admin-api.html#tag/tag-controller - */ -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 查询文章标签列表 - * { - * "sort": ["",""], // 排序 - * "more": "Boolean" ,// 更多参数(回调) - * } - */ - getTagsList: (params) => { - return HttpHandler.Get('/api/admin/tags', params) - }, - - /** - * 查询文章标签详情 - * @param {Number} tagId id - */ - getTagsDetail: (tagId) => { - return HttpHandler.Get(`/api/admin/tags/${tagId}`) - }, - - /** - * 新增文章标签 - * { - * "color": "#e23d66", // 颜色选择器 - * "name": "string", - * "slug": "string", - * "thumbnail": "string" - * } - */ - createTags: (data) => { - return HttpHandler.Post(`/api/admin/tags`, data) - }, - - /** - * 修改文章标签信息 - * @param {Number} tagId id - * @param {Object} data 同新增 - */ - updateTagsById: (tagId, data) => { - return HttpHandler.Put(`/api/admin/tags/${tagId}`, data) - }, - - /** - * 删除文章标签 - * @param {Number} tagId id - */ - deleteTagsById: (tagId) => { - return HttpHandler.Delete(`/api/admin/tags/${tagId}`) - }, -} diff --git a/api/admin/user.js b/api/admin/user.js deleted file mode 100644 index 5d97602..0000000 --- a/api/admin/user.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * 登录管理 - * @see https://api.halo.run/admin-api.html#tag/admin-controller - */ -import HttpHandler from '@/common/http/request.js' - -export default { - // 登录前检查 - loginPreCheck: (data) => { - return HttpHandler.Post('/api/admin/login/precheck', data, {}) - }, - // 登录 - login: (data) => { - return HttpHandler.Post('/api/admin/login', data, {}) - }, - // 刷新token - refreshToken: (refreshToken) => { - return HttpHandler.Post($`/api/admin/refresh/${refreshToken}`, {}, {}) - }, - - // 退出登录 - logout: () => { - return HttpHandler.Post('/api/admin/logout') - }, - - /** - * 获取修改密码的验证码 - * { - * "email": "string", - * "username": "string" - * } - */ - getResetPasswordCode: () => { - return HttpHandler.Post('/api/admin/password/code') - }, - - /** - * 重置密码 - * { - * "code": "string", - * "email": "string", - * "password": "stringst", - * "username": "string" - * } - */ - resetPasswordByCode: (data) => { - return HttpHandler.Put('/api/admin/password/reset', data) - }, - - /** - * 获取个人信息(当前登录的管理员) - */ - getAdminProfile: () => { - return HttpHandler.Get('/api/admin/users/profiles') - }, - - /** - * 修改个人信息(当前登录的管理员) - * { - * "avatar": "string", - * "description": "string", - * "email": "string", - * "nickname": "string", - * "password": "stringst", - * "username": "string" - * } - */ - updateAdminProfile: (data) => { - return HttpHandler.Put('/api/admin/users/profiles', data) - }, - /** - * 修改密码 - * { - * "confirmPassword": "string", - * "newPassword": "string", - * "oldPassword": "strings" - * } - */ - modifyAdminPassword: (data) => { - return HttpHandler.Put('/api/admin/users/profiles/password', data) - }, - -} diff --git a/api/archive.js b/api/archive.js deleted file mode 100644 index e518063..0000000 --- a/api/archive.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 归档接口 - * @see https://api.halo.run/content-api.html#tag/archive-controlle - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取归档列表(按月) - */ - getMonthArchives: () => { - return HttpHandler.Get(`/api/content/archives/months`) - }, - - /** - * 获取归档列表(按年) - */ - getYearArchives: () => { - return HttpHandler.Get(`/api/content/archives/years`) - }, -} diff --git a/api/article.js b/api/article.js deleted file mode 100644 index 2f4c366..0000000 --- a/api/article.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 文章接口 - */ - -import HttpHandler from '@/common/http/request.js' -export default { - /** - * 获取文章列表 - * @param {Object} params 查询参数 - */ - getArticleList: (params) => { - return HttpHandler.Get('/api/content/posts', params) - }, - - /** - * 获取文章详情 - * @param {String} name 文章 name - */ - getArticleDetail: (name) => { - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/posts/${name}`, {}) - }, -} \ No newline at end of file diff --git a/api/blogger.js b/api/blogger.js deleted file mode 100644 index 021c50d..0000000 --- a/api/blogger.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * 博主信息 - * @see https://api.halo.run/content-api.html#tag/user-controller - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取博主信息 - */ - getBloggerInfo: () => { - return HttpHandler.Get(`/api/content/users/profile`) - }, -} diff --git a/api/category.js b/api/category.js deleted file mode 100644 index 7cd997c..0000000 --- a/api/category.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 分类接口 - * @see https://api.halo.run/content-api.html#tag/category-controller - */ - -import HttpHandler from '@/common/http/request.js' -import { getCache } from '@/utils/storage.js' -export default { - /** - * 查询分类列表 - * @param {Object} params 查询参数 - */ - getCategoryList: (params) => { - return HttpHandler.Get('/apis/api.content.halo.run/v1alpha1/categories', params) - }, - - /** - * 根据分类名称查询一个分类 - * @param {String} name 分类名称 - * @param {Object} params 查询参数 - */ - getCategoryPostList: (name, params) => { - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/categories/${name}`, params) - }, - - /** - * 查询分类下的文章 - * @param {String} name 分类名称 - * @param {Object} params 查询参数 - */ - getCategoryPostList: (name, params) => { - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/categories/${name}/posts`, params) - }, - - -} \ No newline at end of file diff --git a/api/comment.js b/api/comment.js deleted file mode 100644 index e2cb234..0000000 --- a/api/comment.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 评论接口 - * @see https://api.halo.run/content-api.html#tag/post-controller - */ -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取评论列表接口(树形数据) - * @param {String} postId 文章id - * @param {Object} params 查询参数 - */ - getPostCommentTree: (postId, params) => { - return HttpHandler.Get(`/api/content/posts/${postId}/comments/tree_view`, params) - }, - - /** - * 获取评论列表接口(列表数据) - * @param {String} name 文章id - * @param {Object} params 查询参数 - */ - getPostCommentList: (name, params) => { - return HttpHandler.Get(`/apis/content.halo.run/v1alpha1/comments${name}`, params) - }, - - /** - * 获取置顶评论 - * @param {String} postId 文章id - * @param {Object} params 查询参数 - */ - getPostTopCommentList: (postId, params) => { - return HttpHandler.Get(`/api/content/posts/${postId}/comments/top_view`, params) - }, - - - /** - * 获取评论的子评论列表 - * @param {String} postId 文章id - * @param {String} commentParentId 要获取的评论id - * @param {Object} params 查询参数 - */ - getPostChildrenCommentList: (postId, commentParentId, params) => { - return HttpHandler.Get(`/api/content/posts/${postId}/comments/${commentParentId}/children`, params) - }, -} \ No newline at end of file diff --git a/api/index.js b/api/index.js index c4dee13..339c11a 100644 --- a/api/index.js +++ b/api/index.js @@ -11,67 +11,12 @@ */ import HttpHandler from '@/common/http/request.js' - -import archive from './archive.js' -import article from './article.js' -import blogger from './blogger.js' -import category from './category.js' -import tag from './tag.js' -import comment from './comment.js' -import journal from './journal.js' -import link from './link.js' -import menu from './menu.js' -import option from './option.js' -import photo from './photo.js' -import post from './post.js' -import sheet from './sheet.js' -import statistics from './statistics.js' -import theme from './theme.js' - -// 管理端 -import admin_login from './admin/user.js' -import admin_links from './admin/links.js' -import admin_attachment from './admin/attachment.js' -import admin_category from './admin/category.js' -import admin_journal from './admin/journal.js' -import admin_photos from './admin/photos.js' -import admin_tags from './admin/tags.js' -import admin_comments from './admin/comments.js' -import admin_posts from './admin/posts.js' -import admin_logs from './admin/logs.js' - + // 2.0接口 import v2 from './v2/all.api.js' const ApiManager = { - v2, - ...archive, - ...article, - ...blogger, - ...category, - ...tag, - ...comment, - ...journal, - ...link, - ...option, - ...photo, - ...post, - ...sheet, - ...statistics, - ...theme, - // 管理端的api - admin: { - ...admin_login, - ...admin_links, - ...admin_attachment, - ...admin_category, - ...admin_journal, - ...admin_photos, - ...admin_tags, - ...admin_comments, - ...admin_posts, - ...admin_logs - } + v2 }; const install = (Vue) => { diff --git a/api/journal.js b/api/journal.js deleted file mode 100644 index 447b408..0000000 --- a/api/journal.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * 日记接口 - * @see https://api.halo.run/content-api.html#tag/journal-controller - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取日记列表 - * @param {String} journalId 日记id - */ - getJournals: () => { - return HttpHandler.Get(`/api/content/journals`) - }, - - /** - * 获取日记详情 - * @param {String} journalId 日记id - */ - getJournalDetail: (journalId) => { - return HttpHandler.Get(`/api/content/journals/${journalId}`) - }, - - /** - * 获取日记置顶评论列表 - * @param {String} journalId 日记id - */ - getJournalTopComments: (journalId) => { - return HttpHandler.Get(`/api/content/journals/${journalId}/comments/top_view`) - }, - - /** - * 获取日记评论列表(列表形式) - * @param {String} journalId 日记id - */ - getJournalCommentList: (journalId) => { - return HttpHandler.Get(`/api/content/journals/${journalId}/comments/list_view`) - }, - - /** - * 获取日记评论列表(树形式) - * @param {String} journalId 日记id - */ - getJournalCommentTree: (journalId) => { - return HttpHandler.Get(`/api/content/journals/${journalId}/comments/tree_view`) - }, - - /** - * 获取日记评论列表(树形式) - * @param {String} journalId 日记id - * @param {String} commentParentId 评论id - */ - getJournalCommentChildren: (journalId, commentParentId) => { - return HttpHandler.Get( - `/api/content/journals/${journalId}/comments/${commentParentId}/children`) - }, - - /** - * 发表日记评论 - * @param {Object} data 评论数据 - */ - postJournalComments: (data) => { - return HttpHandler.Post(`/api/content/journals/comments`, data) - }, - - /** - * 给日记点赞 - * @param {String} journalId 日记id - */ - postJournalLikes: (journalId) => { - return HttpHandler.Post(`/api/content/journals/${journalId}/likes`) - }, -} diff --git a/api/link.js b/api/link.js deleted file mode 100644 index b4d58a9..0000000 --- a/api/link.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 友链接口 - * @see https://api.halo.run/content-api.html#tag/link-controller - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取友链列表 - * @param {Object} params 参数 - */ - getLinkList: (params) => { - return HttpHandler.Get(`/api/content/links`, params) - }, - - /** - * 获取分组的友链列表 - * @param {Object} params 参数 - */ - getLinkListByTeam: (params) => { - return HttpHandler.Get(`/api/content/links/team_view`, params) - }, -} diff --git a/api/login.js b/api/login.js deleted file mode 100644 index 332e8ac..0000000 --- a/api/login.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * 普通用户登录 - */ - -// 获取用户信息 -export function getUserInfo() { - return new Promise((resolve, reject) => { - uni.getUserProfile({ - lang: 'zh_CN', - desc: '用户登录', // 声明获取用户个人信息后的用途,后续会展示在弹窗中, - success: (res) => { - console.log(res, 'resss') - resolve(res.userInfo) - }, - fail: (err) => { - reject(err) - } - }) - }) -} - -export function getLogin() { - return new Promise((resolve, reject) => { - uni.login({ - success(res) { - console.log('----------getLogin ---------') - console.log(res) - resolve(res) - }, - fail: (err) => { - console.log(err, 'logoer') - reject(err) - } - }) - }) -} - -export function wxLogin() { - uni.getProvider({ - service: 'oauth', - success: function(res) { - //支持微信、qq和微博等 - if (~res.provider.indexOf('weixin')) { - console.log(res, 'ress') - let _userInfo = getUserInfo(); - let _loginRes = getLogin(); - Promise.all([_userInfo, _loginRes]).then((res) => { - let userInfo = res[0]; - let loginRes = res[1]; - if (loginRes.errMsg == 'login:ok') { - uni.$tm.vx.commit('user/setWxLoginInfo', { - avatarUrl: userInfo.avatarUrl, - nickName: userInfo.nickName, - email: '', - url: '' - }); - uni.showToast({ - icon: 'none', - title: '登录成功!' - }) - } else { - uni.showToast({ - icon: 'none', - title: '登录失败,请重试!' - }) - } - }).catch(err => { - uni.showToast({ - icon: 'none', - title: '登录失败,请重试!' - }) - }) - } - }, - fail: function(err) { - uni.showToast({ - icon: 'none', - title: '登录失败,请重试!' - }) - } - }) -} - -export function appWxLogin() { - uni.login({ - provider: 'weixin', - success: function(loginRes) { - // 获取用户信息 - uni.getUserInfo({ - provider: 'weixin', - success: function(infoRes) { - uni.$tm.vx.commit('user/setWxLoginInfo', { - avatarUrl: infoRes.userInfo.avatarUrl, - nickName: infoRes.userInfo.nickName, - email: '', - url: '' - }); - uni.showToast({ - icon: 'none', - title: '登录成功!' - }) - }, - fail: function(err) { - uni.showToast({ - icon: 'none', - title: '登录失败,请重试!' - }) - } - }); - } - }); -} diff --git a/api/menu.js b/api/menu.js deleted file mode 100644 index f491877..0000000 --- a/api/menu.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 菜单接口 - * @see https://api.halo.run/content-api.html#tag/menu-controller - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取菜单列表(列表) - * @param {Object} params 参数 - */ - getMenuList: (params) => { - return HttpHandler.Get(`/api/content/menus`, params) - }, - - /** - * 获取菜单列表(树形) - * @param {Object} params 参数 - */ - getMenuTree: (params) => { - return HttpHandler.Get(`/api/content/menus/tree_view`, params) - }, -} diff --git a/api/option.js b/api/option.js deleted file mode 100644 index f84693f..0000000 --- a/api/option.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 配置接口 - * @see https://api.halo.run/content-api.html#tag/option-controller - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 根据key获取配置 - * @param {String} key 配置的key - */ - getOptionByKey: (key) => { - return HttpHandler.Get(`/api/content/options/keys/${key}`) - }, - - /** - * 获取配置列表(列表) - */ - getOptionList: () => { - return HttpHandler.Get(`/api/content/options/list_view`) - }, - - /** - * 获取配置列表(键值对) - */ - getOptionMap: () => { - return HttpHandler.Get(`/api/content/options/map_view`) - }, -} diff --git a/api/photo.js b/api/photo.js deleted file mode 100644 index ae59ed8..0000000 --- a/api/photo.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 图库接口 - * @see https://api.halo.run/content-api.html#tag/photo-controller - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取图库列表(分页查询) - * @param {Object} params 参数 - */ - getPhotoListByPage: (params) => { - return HttpHandler.Get(`/api/content/photos`, params) - }, - - /** - * 获取图库列表(最新) - * @param {Object} params 参数 - */ - getPhotoList: (params) => { - return HttpHandler.Get(`/api/content/photos/latest`, params) - }, - - /** - * 获取图库分组 - */ - getPhotoTeams: () => { - return HttpHandler.Get(`/api/content/photos/teams`) - }, -} diff --git a/api/post.js b/api/post.js deleted file mode 100644 index 7e93cab..0000000 --- a/api/post.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * 文章接口 - * @see https://api.halo.run/content-api.html#tag/post-controller - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取文章列表 - * @param {Object} params 参数 - */ - getPostList: (params) => { - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/posts`, params) - }, - - /** - * 根据名称获取文章 - * @param {String} name 分类名称 - */ - getPostByName: (name) => { - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/posts/${name}`, {}) - }, - - /** - * 评论文章 - * @param {Object} data 数据 - * { - * "allowNotification": true, - * "author": "string", - * "authorUrl": "string", - * "content": "string", - * "email": "string", - * "parentId": 0, - * "postId": 0 - * } - */ - postCommentPost: (data) => { - return HttpHandler.Post(`/api/content/posts/comments`, data) - }, - - /** - * 搜索文章 - * @param {Object} data 数据 - */ - getPostListByKeyword: (data) => { - return HttpHandler.Post(`/api/content/posts/search`, data) - }, - - /** - * 根据分类获取文章 - * @param {Object} params 参数 - */ - getPostDetailBySlug: (params) => { - return HttpHandler.Get(`/api/content/posts/slug`, params) - }, - - /** - * 根据文章id获取文章 - * @param {Object} params 参数 - */ - getPostDetailByPostId: (postId, params) => { - return HttpHandler.Get(`/api/content/posts/${postId}`, params) - }, - - /** - * 给文章点赞 - * @param {Object} postId 文章id - */ - postLikePost: (postId) => { - return HttpHandler.Post(`/api/content/posts/${postId}/likes`) - }, - - /** - * 根据当前文章id获取前一篇文章 - * @param {Object} postId 文章id - */ - getPrevByCurrentPostId: (postId) => { - return HttpHandler.Get(`/api/content/posts/${postId}/prev`) - }, - - /** - * 根据当前文章id获取下一篇文章 - * @param {Object} postId 文章id - */ - getNextByCurrentPostId: (postId) => { - return HttpHandler.Get(`/api/content/posts/${postId}/next`) - }, - -} \ No newline at end of file diff --git a/api/sheet.js b/api/sheet.js deleted file mode 100644 index 492ef08..0000000 --- a/api/sheet.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * 自定义页面模板 - * @see https://api.halo.run/content-api.html#tag/sheet-controller - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取页面列表 - * { - * page: - * size: - * sort: - * } - */ - getSheetsList: (params) => { - return HttpHandler.Get(`/api/content/sheets`, params) - }, - - /** - * 根据分类获取页面数据 - */ - getSheetsListBySlug: (params) => { - return HttpHandler.Get(`/api/content/sheets/slug`, params) - }, - - /** - * 获取页面评论(列表) - */ - getSheetsCommentsListBySheetId: (sheetId, params) => { - return HttpHandler.Get(`/api/content/sheets/${sheetId}/comments/list_view`, params) - }, - /** - * 获取页面评论(树形) - */ - getSheetsCommentsTreeBySheetId: (sheetId, params) => { - return HttpHandler.Get(`/api/content/sheets/${sheetId}/comments/tree_view`, params) - }, - - - /** - * 获取评论的子评论列表 - * @param {String} sheetId 页面id - * @param {String} commentParentId 要获取的评论id - * @param {Object} params 查询参数 - */ - getSheetsChildrenCommentList: (sheetId, commentParentId, params) => { - return HttpHandler.Get(`/api/content/sheets/${sheetId}/comments/${commentParentId}/children`, params) - }, - - /** - * 给页面添加一个评论 - * { - * "allowNotification": true, - * "author": "string", - * "authorUrl": "string", - * "content": "string", - * "email": "string", - * "parentId": 0, - * "postId": 0 - * } - */ - postSheetsComments: (data) => { - return HttpHandler.Post(`/api/content/sheets/comments`, data) - }, -} diff --git a/api/statistics.js b/api/statistics.js deleted file mode 100644 index 52fcf8a..0000000 --- a/api/statistics.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 博客统计信息 - * @see https://api.halo.run/content-api.html#tag/statistic-controller - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取博客统计信息 - */ - getBlogStatistics: () => { - return HttpHandler.Get(`/api/content/statistics`) - }, - - /** - * 获取博客统计信息和用户信息 - */ - getBlogStatisticsWithUser: () => { - return HttpHandler.Get(`/api/content/statistics/user`) - }, -} diff --git a/api/tag.js b/api/tag.js deleted file mode 100644 index 9576c40..0000000 --- a/api/tag.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 标签接口 - * @see https://api.halo.run/content-api.html#tag/tag-controller - */ - -import HttpHandler from '@/common/http/request.js' -export default { - /** - * 查询标签列表 - * @param {Object} params 查询参数 - */ - getTagList: (params) => { - return HttpHandler.Get('/api/content/tags', params) - }, - - /** - * 查询标签下的文章 - * @param {String} slug 别名 - * @param {Object} params 查询参数 - */ - getTagPostsList: (slug, params) => { - return HttpHandler.Get(`/api/content/tags/${slug}/posts`, params) - }, -} diff --git a/api/theme.js b/api/theme.js deleted file mode 100644 index 3de526b..0000000 --- a/api/theme.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 主题设置 - * @see https://api.halo.run/content-api.html#tag/theme-controller - */ - -import HttpHandler from '@/common/http/request.js' - -export default { - /** - * 获取激活主题的信息 - * @param {Object} params 参数 - */ - geActivationThemeList: (params) => { - return HttpHandler.Get(`/api/content/themes/activation`, params) - }, - - /** - * 获取激活的主题设置 - * @param {Object} params 参数 - */ - getActivationThemeSettings: (params) => { - return HttpHandler.Get(`/api/content/themes/activation/settings`, params) - }, - - /** - * 根据主题ID列出主题设置 - * @param {Object} params 参数 - */ - getThemeSettingsByThemeId: (themeId) => { - return HttpHandler.Get(`/api/content/themes/${themeId}/settings`) - }, - - /** - * 通过主题ID获取主题属性 - * @param {Object} params 参数 - */ - getThemePropertyByThemeId: (themeId) => { - return HttpHandler.Get(`/api/content/themes/${themeId}`) - }, -} diff --git a/api/url.js b/api/url.js deleted file mode 100644 index 8b13789..0000000 --- a/api/url.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/pages.json b/pages.json index b9be93a..27d034a 100644 --- a/pages.json +++ b/pages.json @@ -305,295 +305,6 @@ } ] }, - { - "root": "pagesB", - "pages": [ - { - "path": "login/login", - "style": { - "navigationBarTitleText": "登录", - "enablePullDownRefresh": false, - "navigationStyle": "custom" - } - }, - { - "path": "admin/admin", - "style": { - "navigationBarTitleText": "工作台", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "settings/settings", - "style": { - "navigationBarTitleText": "系统设置", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "journal/journal", - "style": { - "navigationBarTitleText": "日记管理", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "journal/journal-edit", - "style": { - "navigationBarTitleText": "", - "enablePullDownRefresh": false, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "articles/articles", - "style": { - "navigationBarTitleText": "文章管理", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "articles/article-edit", - "style": { - "navigationBarTitleText": "写文章", - "enablePullDownRefresh": false - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "articles/article-setting", - "style": { - "navigationBarTitleText": "文章设置", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "category/category", - "style": { - "navigationBarTitleText": "分类管理", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "tags/tags", - "style": { - "navigationBarTitleText": "标签管理", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "attachment/attachment", - "style": { - "navigationBarTitleText": "附件管理", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "links/links", - "style": { - "navigationBarTitleText": "友链管理", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "photos/photos", - "style": { - "navigationBarTitleText": "图库管理", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "photos/photos-edit", - "style": { - "navigationBarTitleText": "新增/编辑图片", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "comments/comments", - "style": { - "navigationBarTitleText": "评论管理", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "menus/menus", - "style": { - "navigationBarTitleText": "菜单管理", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "password/password", - "style": { - "navigationBarTitleText": "修改密码", - "enablePullDownRefresh": false - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "profile/profile", - "style": { - "navigationBarTitleText": "个人信息", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - }, - { - "path": "logs/logs", - "style": { - "navigationBarTitleText": "日志管理", - "enablePullDownRefresh": true, - "app-plus": { - "pullToRefresh": { - "color": "#03a9f4", - "style": "circle" - } - } - }, - "meta": { - "auth": "admin" - } - } - ] - }, { "root": "pagesC", "pages": [ diff --git a/pagesA/article-detail/article-detail.vue b/pagesA/article-detail/article-detail.vue index d61b80b..018a158 100644 --- a/pagesA/article-detail/article-detail.vue +++ b/pagesA/article-detail/article-detail.vue @@ -148,7 +148,7 @@ - + 评论详情 { console.log("请求成功:", res) diff --git a/pagesB/admin/admin.vue b/pagesB/admin/admin.vue deleted file mode 100644 index b58c228..0000000 --- a/pagesB/admin/admin.vue +++ /dev/null @@ -1,285 +0,0 @@ - - - - - diff --git a/pagesB/articles/article-edit.vue b/pagesB/articles/article-edit.vue deleted file mode 100644 index 2a3d9a9..0000000 --- a/pagesB/articles/article-edit.vue +++ /dev/null @@ -1,689 +0,0 @@ - - - - - diff --git a/pagesB/articles/article-setting.vue b/pagesB/articles/article-setting.vue deleted file mode 100644 index 8a989ce..0000000 --- a/pagesB/articles/article-setting.vue +++ /dev/null @@ -1,763 +0,0 @@ - - - - - diff --git a/pagesB/articles/articles.vue b/pagesB/articles/articles.vue deleted file mode 100644 index a9084f7..0000000 --- a/pagesB/articles/articles.vue +++ /dev/null @@ -1,414 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pagesB/attachment/attachment.vue b/pagesB/attachment/attachment.vue deleted file mode 100644 index 9f981e7..0000000 --- a/pagesB/attachment/attachment.vue +++ /dev/null @@ -1,751 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pagesB/category/category.vue b/pagesB/category/category.vue deleted file mode 100644 index 429cea1..0000000 --- a/pagesB/category/category.vue +++ /dev/null @@ -1,395 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pagesB/comments/comments.vue b/pagesB/comments/comments.vue deleted file mode 100644 index f89ffe1..0000000 --- a/pagesB/comments/comments.vue +++ /dev/null @@ -1,472 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pagesB/journal/journal-edit.vue b/pagesB/journal/journal-edit.vue deleted file mode 100644 index 8b2a571..0000000 --- a/pagesB/journal/journal-edit.vue +++ /dev/null @@ -1,620 +0,0 @@ - - - - - diff --git a/pagesB/journal/journal.vue b/pagesB/journal/journal.vue deleted file mode 100644 index fd43787..0000000 --- a/pagesB/journal/journal.vue +++ /dev/null @@ -1,171 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pagesB/links/links.vue b/pagesB/links/links.vue deleted file mode 100644 index 0fd5dc2..0000000 --- a/pagesB/links/links.vue +++ /dev/null @@ -1,415 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pagesB/login/login.vue b/pagesB/login/login.vue deleted file mode 100644 index b4a9145..0000000 --- a/pagesB/login/login.vue +++ /dev/null @@ -1,185 +0,0 @@ - - - - - diff --git a/pagesB/logs/logs.vue b/pagesB/logs/logs.vue deleted file mode 100644 index 6c294c7..0000000 --- a/pagesB/logs/logs.vue +++ /dev/null @@ -1,309 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pagesB/menus/menus.vue b/pagesB/menus/menus.vue deleted file mode 100644 index b1da8bb..0000000 --- a/pagesB/menus/menus.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - - - diff --git a/pagesB/password/password.vue b/pagesB/password/password.vue deleted file mode 100644 index 34cbb96..0000000 --- a/pagesB/password/password.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - - - diff --git a/pagesB/photos/photos-edit.vue b/pagesB/photos/photos-edit.vue deleted file mode 100644 index 8c3b35f..0000000 --- a/pagesB/photos/photos-edit.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/pagesB/photos/photos.vue b/pagesB/photos/photos.vue deleted file mode 100644 index 9a40ba1..0000000 --- a/pagesB/photos/photos.vue +++ /dev/null @@ -1,476 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pagesB/profile/profile.vue b/pagesB/profile/profile.vue deleted file mode 100644 index 2108e50..0000000 --- a/pagesB/profile/profile.vue +++ /dev/null @@ -1,249 +0,0 @@ - - - - - diff --git a/pagesB/settings/settings.vue b/pagesB/settings/settings.vue deleted file mode 100644 index b1da8bb..0000000 --- a/pagesB/settings/settings.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - - - diff --git a/pagesB/tags/tags.vue b/pagesB/tags/tags.vue deleted file mode 100644 index a244d33..0000000 --- a/pagesB/tags/tags.vue +++ /dev/null @@ -1,371 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pagesB/template.vue b/pagesB/template.vue deleted file mode 100644 index bffefbe..0000000 --- a/pagesB/template.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - - - diff --git a/router/router.js b/router/router.js index 62668c0..c83f0ff 100644 --- a/router/router.js +++ b/router/router.js @@ -8,12 +8,7 @@ const router = createRouter({ platform: process.env.VUE_APP_PLATFORM, routes: [...ROUTES] }); - -import { - wxLogin, - appWxLogin -} from '@/api/login.js' - + import { checkHasWxLogin, checkHasAdminLogin @@ -21,60 +16,7 @@ import { //全局路由前置守卫 router.beforeEach((to, from, next) => { - // 管理页面:超管 - if (to.meta && to.meta.auth == 'admin') { - if (checkHasAdminLogin()) { - next() - } else { - uni.$eShowModal({ - title: '提示', - content: '未登录超管账号或登录状态已过期,是否立即登录?', - showCancel: true, - cancelText: '否', - cancelColor: '#999999', - confirmText: '是', - confirmColor: '#03a9f4' - }).then(res => { - uni.navigateTo({ - url: '/pagesB/login/login' - }) - }).catch(err => { - uni.switchTab({ - url: '/pages/tabbar/about/about' - }) - }) - next(false) - } - } - // 普通用户需要登录 - else if (to.meta && to.meta.auth == 'login') { - if (checkHasWxLogin()) { - next() - } else { - uni.$eShowModal({ - title: '提示', - content: `主人,您好像还没有登录呢?`, - showCancel: true, - cancelText: '取消', - cancelColor: '#999999', - confirmText: '登录', - confirmColor: '#03a9f4' - }).then(res => { - // #ifdef APP-PLUS - appWxLogin() - // #endif - // #ifdef MP-WEIXIN - wxLogin() - // #endif - // #ifndef APP-PLUS||MP-WEIXIN - - // #endif - }).catch(err => {}) - next(false) - } - } else { - next(); - } + next(); }); // 全局路由后置守卫 router.afterEach((to, from) => { @@ -84,4 +26,4 @@ router.afterEach((to, from) => { export { router, RouterMount -} +} \ No newline at end of file diff --git a/store/article.js b/store/article.js deleted file mode 100644 index dfa40a6..0000000 --- a/store/article.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 功能:临时存储文章信息(用于编辑) - * 作者:小莫唐尼 - * 邮箱:studio@925i.cn - * 时间:2022年07月21日 18:41:44 - * 版本:v0.1.0 - * 修改记录: - * 修改内容: - * 修改人员: - * 修改时间: - */ -export default { - namespaced: true, - state: { - articleInfo: null, - }, - getters: { - getArticleInfo(state) { - return state.articleInfo - }, - }, - mutations: { - setArticleInfo(state, data) { - state.articleInfo = data; - }, - }, -}; diff --git a/store/auth.js b/store/auth.js index 20a3794..a99aa5c 100644 --- a/store/auth.js +++ b/store/auth.js @@ -9,7 +9,7 @@ * 修改人员: * 修改时间: */ -import User from '@/api/admin/user.js' + import HaloConfig from '@/config/halo.config.js'; import { getWxLoginInfo @@ -19,46 +19,22 @@ import { getCache } from '@/utils/storage.js' export default { - state: { - // 超管登录 - adminToken: getCache('APP_ADMIN_LOGIN_TOKEN'), - + state: { // 微信登录的信息 wxLoginInfo: getWxLoginInfo(), }, - getters: { - getAdminToken(state) { - return getCache('APP_ADMIN_LOGIN_TOKEN') - }, + getters: { getWxLoginInfo(state) { return state.wxLoginInfo }, }, - mutations: { - setAdminToken(state, data) { - state.adminToken = data - setCache('APP_ADMIN_LOGIN_TOKEN', data, data?.expired_in) - }, + mutations: { setWxLoginInfo(state, data) { state.wxLoginInfo = data uni.setStorageSync('APP_WX_LOGIN_INFO', JSON.stringify(data)) }, }, - actions: { - adminLogin(context, data) { - return new Promise((resolve, reject) => { - User.login(data).then((res) => { - if (res.status == 200) { - context.commit("setAdminToken", res.data); - resolve(res) - } else { - reject(err) - } - }).catch((err) => { - reject(err) - }); - }) - }, + actions: { checkAndSetDefaultUser(context) { if (!context.state.wxLoginInfo) { context.commit('setWxLoginInfo', { @@ -68,9 +44,6 @@ export default { url: '' }) } - }, - adminLogout(context) { - context.commit("setAdminToken", null); - } + } }, }; diff --git a/store/blogger.js b/store/blogger.js index a3a4542..fa95d57 100644 --- a/store/blogger.js +++ b/store/blogger.js @@ -8,8 +8,7 @@ * 修改内容: * 修改人员: * 修改时间: - */ -import Blogger from '@/api/blogger.js' + */ import HaloConfig from '@/config/halo.config.js'; export default { state: { diff --git a/store/journal.js b/store/journal.js deleted file mode 100644 index f55cdb6..0000000 --- a/store/journal.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 功能:临时存储日记信息(用于编辑) - * 作者:小莫唐尼 - * 邮箱:studio@925i.cn - * 时间:2022年07月21日 18:41:44 - * 版本:v0.1.0 - * 修改记录: - * 修改内容: - * 修改人员: - * 修改时间: - */ -export default { - namespaced: true, - state: { - journalInfo: null, - }, - getters: { - getJournalInfo(state) { - return state.journalInfo - }, - }, - mutations: { - setJournalInfo(state, data) { - state.journalInfo = data; - }, - }, -}; diff --git a/store/user.js b/store/user.js index 20a3794..719107c 100644 --- a/store/user.js +++ b/store/user.js @@ -9,7 +9,6 @@ * 修改人员: * 修改时间: */ -import User from '@/api/admin/user.js' import HaloConfig from '@/config/halo.config.js'; import { getWxLoginInfo @@ -20,45 +19,23 @@ import { } from '@/utils/storage.js' export default { state: { - // 超管登录 - adminToken: getCache('APP_ADMIN_LOGIN_TOKEN'), - // 微信登录的信息 wxLoginInfo: getWxLoginInfo(), }, getters: { - getAdminToken(state) { - return getCache('APP_ADMIN_LOGIN_TOKEN') - }, + getWxLoginInfo(state) { return state.wxLoginInfo }, }, mutations: { - setAdminToken(state, data) { - state.adminToken = data - setCache('APP_ADMIN_LOGIN_TOKEN', data, data?.expired_in) - }, setWxLoginInfo(state, data) { state.wxLoginInfo = data uni.setStorageSync('APP_WX_LOGIN_INFO', JSON.stringify(data)) }, }, actions: { - adminLogin(context, data) { - return new Promise((resolve, reject) => { - User.login(data).then((res) => { - if (res.status == 200) { - context.commit("setAdminToken", res.data); - resolve(res) - } else { - reject(err) - } - }).catch((err) => { - reject(err) - }); - }) - }, + checkAndSetDefaultUser(context) { if (!context.state.wxLoginInfo) { context.commit('setWxLoginInfo', { @@ -69,8 +46,6 @@ export default { }) } }, - adminLogout(context) { - context.commit("setAdminToken", null); - } + }, };