From 254d0b924b5d8ea61a9a0e99b3911f53c0e175de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= Date: Wed, 2 Sep 2026 00:51:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E6=9E=84=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E4=B8=8E=E8=AF=B7=E6=B1=82=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 请求层:非 200 响应统一抛 UniHaloError,Halo 来源响应归一化 - 评论弹窗:新增 allowNotification、验证码错误自动刷新与错误详情提示 - 评论回复结构调整为分页结果(replies.items) - 首页:快捷导航改 5 列、最新列表跳转搜索页,移除旧文章列表页 - 图库:分类切换改用 wd-tabs/wd-tab 组件 - 新增搜索页、uh-data-loading 组件、useDataLoadingStatus 与 exception 工具 Co-Authored-By: AtomCode (deepseek-v4-flash) --- .gitignore | 4 +- src/App.vue | 5 + src/api/halo.ts | 5 +- src/api/types/halo.ts | 4 +- src/api/uni-halo.ts | 3 +- .../uh-comment-list/uh-comment-list.vue | 4 +- .../uh-comment-modal/uh-comment-modal.vue | 589 +++++++++--------- .../uh-data-loading/uh-data-loading.vue | 41 ++ src/hooks/useDataLoadingStatus.ts | 24 + src/http/alova.ts | 217 +++---- src/http/interceptor.ts | 10 +- src/http/tools/exception.ts | 22 + src/http/types.ts | 1 + .../article-detail/article-detail.vue | 238 +++---- .../articles.vue => search/search.vue} | 61 +- src/pages/index/index.vue | 2 +- src/pages/tabbar/gallery/gallery.vue | 24 +- src/pages/tabbar/home/home.vue | 82 +-- src/pages/tabbar/moments/moments.vue | 24 +- 19 files changed, 737 insertions(+), 623 deletions(-) create mode 100644 src/components/uh-data-loading/uh-data-loading.vue create mode 100644 src/hooks/useDataLoadingStatus.ts create mode 100644 src/http/tools/exception.ts rename src/pages-blog/{articles/articles.vue => search/search.vue} (81%) diff --git a/.gitignore b/.gitignore index 4357cea..02937c0 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,6 @@ src/pages.json # npx @dcloudio/uvm@latest -.docs/ \ No newline at end of file +.docs/ +.screenshots/ +.design/ \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index c17eb06..a5c4e4b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,6 +4,7 @@ import { getCurrentInstance, onMounted, onUnmounted } from 'vue' import { navigateToInterceptor } from '@/router/interceptor' import { tabbarStore } from '@/tabbar/store' import { permission } from '@/router/permission' +import { useAppConfigStore } from '@/store/appConfig' const { proxy } = (getCurrentInstance() || {}) as any const router = proxy?.$router @@ -11,6 +12,10 @@ const router = proxy?.$router router && permission.install(router) onLaunch((options) => { + + // 初始化获取配置 + useAppConfigStore() + console.log('App.vue onLaunch', options) }) onShow((options) => { diff --git a/src/api/halo.ts b/src/api/halo.ts index d2f9d65..f3a99be 100644 --- a/src/api/halo.ts +++ b/src/api/halo.ts @@ -1,9 +1,5 @@ /** * Halo 官方 API 接口定义 - * 覆盖官方扩展点:api.content.halo.run / api.halo.run / api.moment.halo.run / - * api.photo.halo.run / api.link.halo.run / api.plugin.halo.run - * 风格参考 src/api/foo-alova.ts:http.Get>(url, { params, header, meta }) - * 源自旧项目 api/v2/all.api.js(官方部分),按需命名导出 */ import { http } from '@/http/alova'; import { RequestFrom } from '@/http/tools/enum'; @@ -144,6 +140,7 @@ export function getPostCommentReplyList(commentName: string, params: ICommentLis /** 新增评论(带验证码,captchaCode 转入请求头) */ export interface IAddCommentReq { + allowNotification: boolean; raw: string; content?: string; owner?: Record; diff --git a/src/api/types/halo.ts b/src/api/types/halo.ts index 4fbab4f..53d47a3 100644 --- a/src/api/types/halo.ts +++ b/src/api/types/halo.ts @@ -114,6 +114,8 @@ export type IPostListRes = IListResult /** 文章搜索请求参数(关键字) */ export interface ISearchReq { keyword?: string + /** 返回条数上限(旧版默认 50) */ + limit?: number page?: number size?: number highlightPreTag?: string @@ -226,7 +228,7 @@ export interface IComment { replyCount?: number visibleTime?: string } - replies?: ICommentReply[] + replies?: IListResult } export interface ICommentReply { diff --git a/src/api/uni-halo.ts b/src/api/uni-halo.ts index 3e7606c..97d7d6c 100644 --- a/src/api/uni-halo.ts +++ b/src/api/uni-halo.ts @@ -284,7 +284,8 @@ export function getDoubanDetail(url: string) { */ export function getCommentWidgetCaptcha() { return http.Get>('/apis/api.commentwidget.halo.run/v1alpha1/captcha/-/generate', { - meta: { requestFrom: RequestFrom.Halo }, + cacheFor:0, + meta: { requestFrom: RequestFrom.Halo }, }) } diff --git a/src/components/uh-comment-list/uh-comment-list.vue b/src/components/uh-comment-list/uh-comment-list.vue index 794d7a3..ca1638b 100644 --- a/src/components/uh-comment-list/uh-comment-list.vue +++ b/src/components/uh-comment-list/uh-comment-list.vue @@ -155,9 +155,9 @@ handleGetData() /> -