1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-11-13 22:11:42 +08:00

fix: 修复配置类接口缓存问题,统一添加cacheFor:0绕过alova内存缓存

1. 为所有获取应用配置、审核数据、爱心配置、评论列表、插件可用性的接口添加cacheFor:0参数,确保配置变更后即时生效
2. 修复home.vue和maintenance.vue的缩进格式问题,统一代码风格
3. 新增uni-halo项目开发规范文档
This commit is contained in:
小莫唐尼
2026-09-04 13:49:21 +08:00
parent 2fbd3fb19a
commit 570c394501
5 changed files with 1708 additions and 1007 deletions
+3 -2
View File
@@ -124,7 +124,7 @@ export function getPostByTagName(tagName: string, params: IPostListReq) {
export function getPostCommentList(params: ICommentListReq) {
return http.Get<IResponse<ICommentListRes>>('/apis/api.halo.run/v1alpha1/comments', {
params,
cacheFor: 0,
cacheFor: 0,
meta: { requestFrom: RequestFrom.Halo },
})
}
@@ -135,7 +135,7 @@ export function getPostCommentList(params: ICommentListReq) {
export function getPostCommentReplyList(commentName: string, params: ICommentListReq) {
return http.Get<IResponse<ICommentListRes>>(`/apis/api.halo.run/v1alpha1/comments/${commentName}/reply`, {
params,
cacheFor: 0,
cacheFor: 0,
meta: { requestFrom: RequestFrom.Halo },
})
}
@@ -294,6 +294,7 @@ export function postTrackersCounter(data: ITrackerCounterReq) {
*/
export function checkPluginAvailable(name: string) {
return http.Get<IResponse<IPluginAvailable>>(`/apis/api.plugin.halo.run/v1alpha1/plugins/${name}/available`, {
cacheFor: 0,
meta: { requestFrom: RequestFrom.Halo },
})
}
+5
View File
@@ -56,9 +56,12 @@ const COMMENT_WIDGET_CAPTCHA_COOKIES = 'comment-widget-captcha'
/**
* 获取应用配置
* 注意:cacheFor: 0 绕过 alova 内存缓存——维护模式/配置变更后需即时生效
* (维护页刷新、入口/首页拦截均依赖本接口的最新状态)
*/
export function getAppConfigs() {
return http.Get<IResponse<IAppConfig>>('/apis/api.unihalo.ialley.cn/v1alpha1/plugins/plugin-uni-halo/getConfigs', {
cacheFor: 0,
meta: { requestFrom: RequestFrom.Halo },
})
}
@@ -68,6 +71,7 @@ export function getAppConfigs() {
*/
export function getAuditData() {
return http.Get<IResponse<IAuditDataResult>>('/apis/api.unihalo.ialley.cn/v1alpha1/plugins/plugin-uni-halo/audit-data', {
cacheFor: 0,
meta: { requestFrom: RequestFrom.Halo },
})
}
@@ -196,6 +200,7 @@ export function getNoticeDetail(name: string) {
*/
export function getLoveConfig() {
return http.Get<IResponse<ILoveConfig>>('/apis/api.unihalo.ialley.cn/v1alpha1/plugins/plugin-uni-halo/love-config', {
cacheFor: 0,
meta: { requestFrom: RequestFrom.Halo },
})
}