1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-09-12 16:40:40 +08:00

chore: 批量新增项目依赖、工具函数、页面与组件资源

1. 新增mp-html、qs等生产依赖,补全项目基础库
2. 新增平台判断、缓存、工具函数等通用工具集
3. 新增标签页、网站浏览页、关于页等业务页面
4. 新增分类卡片、通知弹窗等业务组件
5. 新增uts-progressNotification、liu-poster、uhalo-upgrade等uni模块
6. 补充audio/video组件样式补件,修复uni-components路径缺失问题
7. 新增环境变量Halo个人令牌配置项
8. 重构store导出结构,新增appConfig/halo/setting三个状态模块
9. 新增tsconfig编译目标配置,适配更高版本ES语法
This commit is contained in:
小莫唐尼
2026-08-31 19:56:16 +08:00
parent ba5b77568b
commit 067f3ed98a
147 changed files with 20866 additions and 325 deletions
+55
View File
@@ -0,0 +1,55 @@
/**
* 应用配置默认值(源自旧项目 config/index.js 的 DefaultAppConfigs)
* 与 src/api/uni-halo.ts 的 getAppConfigs(plugin-uni-halo/getConfigs)配合,deepMerge 使用
* 页面/组件依赖其字段结构(pluginConfig.toolsPlugin.Authorization 等),改动需谨慎
*/
import type { IAppConfig } from '@/api/types/uni-halo'
export const DefaultAppConfigs: IAppConfig = {
basicConfig: {
tokenConfig: {
personalToken: '',
},
},
loveConfig: {},
imagesConfig: {},
authorConfig: {},
appConfig: {},
pluginConfig: {
votePlugin: {},
toolsPlugin: {},
linksPlugin: {},
linksSubmitPlugin: {},
doubanPlugin: {
position: 'bottom',
},
},
pageConfig: {
homeConfig: {
pageTitle: '首页',
useCategory: true,
bannerConfig: {
enabled: true,
showTitle: true,
showIndicator: true,
height: '400rpx',
dotPosition: 'right',
type: 'post',
list: [],
},
},
categoryConfig: {
type: 'list',
},
momentConfig: {
useTagRandomColor: true,
},
},
auditConfig: {
auditModeEnabled: false,
auditModeData: {
jsonUrl: '',
jsonData: '',
},
},
}
+91
View File
@@ -0,0 +1,91 @@
/**
* 应用设置默认值与类型(源自旧项目 utils/app.js 的 _DefaultAppSettings)
*/
export interface IAppSettings {
/** 是否每次启动都显示启动页 */
showStartPage: boolean
/** 评论头像是否圆形 */
isAvatarRadius: boolean
banner: {
useDot: boolean
dotPosition: string
}
/** 布局配置 */
layout: {
/** h_row_col1 = 一行一列 / h_row_col2 = 一行两列 */
home: string
/** lr_image_text=左图右文 / lr_text_image=左文右图 / tb_image_text=上图下文 / tb_text_image=上文下图 / only_text=仅文字 */
cardType: string
}
/** 广告配置 */
ad: {
/** 屏蔽广告时长,时间到后自动恢复展示(单位小时) */
timeout: number
/** 是否屏蔽广告 */
disabled: boolean
}
/** 评论弹幕(文章详情) */
barrage: {
use: boolean
/** 弹幕位置(rightToLeft / leftBottom) */
type: string
}
gallery: {
/** 是否使用瀑布流 */
useWaterfull: boolean
}
links: {
useSimple: boolean
useGroup: boolean
}
about: {
/** 显示后台登录入口 */
showAdmin: boolean
/** 显示所有的统计信息(关于页面) */
showAllCount: boolean
}
/** 文章配置 */
article: Record<string, unknown>
/** 联系博主页面 */
contact: {
/** 链接是否使用复制的方式,否则直接在内部打开 */
isLinkCopy: boolean
}
}
export const DefaultAppSettings: IAppSettings = {
showStartPage: false,
isAvatarRadius: false,
banner: {
useDot: true,
dotPosition: 'right',
},
layout: {
home: 'h_row_col1',
cardType: 'lr_image_text',
},
ad: {
timeout: 3,
disabled: false,
},
barrage: {
use: false,
type: 'leftBottom',
},
gallery: {
useWaterfull: true,
},
links: {
useSimple: false,
useGroup: false,
},
about: {
showAdmin: false,
showAllCount: false,
},
article: {},
contact: {
isLinkCopy: true,
},
}
+14
View File
@@ -0,0 +1,14 @@
/**
* Halo 全局配置默认值(源自旧项目 config/halo.config.js)
* 与 src/api/uni-halo.ts 的 getHaloGlobalInfo(/actuator/globalinfo)配合,deepMerge 使用
*/
import type { IHaloGlobalConfig } from '@/api/types/uni-halo'
export const DefaultHaloGlobalConfigs: IHaloGlobalConfig = {
allowAnonymousComments: true,
allowRegistration: true,
mustVerifyEmailOnRegistration: true,
mustVerifyPhoneOnRegistration: false,
restrictRegistrationDomain: false,
shopDisabled: true,
}
+102
View File
@@ -0,0 +1,102 @@
/**
* mp-html 富文本 / markdown 渲染业务配置
* 源自旧项目 common/markdown/markdown.config.js,TS 化复刻(业务封装新建,插件本体走 npm mp-html)
* 用法:<mp-html :content="html" :tag-style="markdownConfig.tagStyle" :container-style="markdownConfig.containStyle" />
*/
import { checkImageUrl } from '@/utils/url'
export const markdownConfig = {
/** 图片域名前缀(mp-html 相对路径补全,源自旧配置 domain: BASE_API) */
domain: import.meta.env.VITE_SERVER_BASEURL || '',
/** 标签样式定制(表格/引用/标题/代码等) */
tagStyle: {
table: `
table-layout: fixed;
border-collapse:collapse;
margin-bottom: 18px;
overflow: hidden;
font-size: 13px;
color: var(--routine);
background: #f2f6fc;
border: 1px solid #dcdcdc;
border-radius: 4px;
`,
th: `
padding: 8px;
border-right: 1px solid var(--classE);
border-bottom: 1px solid var(--classE);
`,
td: `
padding: 8px;
border-right: 1px solid var(--classE);
border-bottom: 1px solid var(--classE);
`,
blockquote: `
padding: 8px 15px;
color: #606266;
background: #f2f6fc;
border-left: 5px solid #50bfff;
border-radius: 4px;
line-height: 26px;
margin-bottom: 18px;
`,
ul: 'padding-left: 15px;line-height: 1.85;',
ol: 'padding-left: 15px;line-height: 1.85;',
li: 'margin-bottom: 12px;line-height: 1.85;',
h1: `
margin: 30px 0 20px;
color: var(--main);
line-height: 24px;
position: relative;
font-size:1.2em;
`,
h2: `
color: var(--main);
line-height: 24px;
position: relative;
margin: 22px 0 16px;
font-size: 1.16em;
`,
h3: `
color: var(--main);
line-height: 24px;
position: relative;
margin: 26px 0 18px;
font-size: 1.14em;
`,
h4: `
color: var(--main);
line-height: 24px;
margin-bottom: 18px;
position: relative;
font-size: 1.12em;
`,
h5: `
color: var(--main);
line-height: 24px;
margin-bottom: 14px;
position: relative;
font-size: 1.1em;
`,
h6: `
color: #303133;
line-height: 24px;
margin-bottom: 14px;
position: relative;
font-size: 14px;
`,
p: `
line-height: 1.65;
margin-bottom: 14px;
font-size: 14px;
`,
code: ' ',
strong: 'font-weight: 700;color: rgb(248, 57, 41);',
video: 'width: 100%',
},
/** 容器样式 */
containStyle: 'font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif;padding:12px;font-size: 14px;color: #606266;word-spacing: 0.8px;letter-spacing: 0.8px;border-radius: 6px;background-color:#FFFFFF;',
/** 加载图 / 空图(来自应用配置 imagesConfig) */
loadingGif: checkImageUrl(undefined),
emptyGif: checkImageUrl(undefined),
}