mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-11-13 22:11:42 +08:00
refactor: 移除启动页逻辑,新增全局组件与偏好设置系统
1. 移除旧版启动页分流逻辑,直接跳转首页 2. 新增返回顶部、章节标题、导航栏等全局组件 3. 重构偏好设置系统,实现站点默认与本地差异分层管理 4. 删除冗余的测试mock、插件模块与样式文件 5. 优化文章卡片与评论组件样式,更新全局主题色 6. 清理废弃的请求参数与配置项
This commit is contained in:
@@ -12,6 +12,8 @@ import type { IAppConfig, IAuditDataResult } from '@/api/types/uni-halo'
|
||||
|
||||
/** 个人令牌存储 key(与 src/store/token.ts 的 getPersonalToken 保持一致) */
|
||||
const APP_TOKENS_KEY = 'APP_TOKENS'
|
||||
/** 合并后配置缓存 key(与 utils/url.ts / api/uni-halo.ts 的 APP_GLOBAL_CONFIGS 读取保持一致) */
|
||||
const APP_GLOBAL_CONFIGS_KEY = 'APP_GLOBAL_CONFIGS'
|
||||
|
||||
export const useAppConfigStore = defineStore(
|
||||
'appConfig',
|
||||
@@ -36,6 +38,10 @@ export const useAppConfigStore = defineStore(
|
||||
if (body) {
|
||||
configs.value = deepMerge(JSON.parse(JSON.stringify(DefaultAppConfigs)), body)
|
||||
|
||||
// 合并结果写入 APP_GLOBAL_CONFIGS 缓存,供 utils/url.ts 图片兜底与
|
||||
// api/uni-halo.ts 第三方插件授权头等按 storage 路径读取
|
||||
setCache(APP_GLOBAL_CONFIGS_KEY, configs.value)
|
||||
|
||||
// 存储个人令牌(供 getPersonalToken 使用,如非匿名投票)
|
||||
if (body?.basicConfig?.tokenConfig) {
|
||||
setCache(APP_TOKENS_KEY, body.basicConfig.tokenConfig)
|
||||
|
||||
Reference in New Issue
Block a user