miroir de
https://github.com/ialley-workshop-open/uni-halo.git
synchronisé 2026-06-10 11:59:28 +08:00
feat: 文章详情支持豆瓣插件
Cette révision appartient à :
+55
-52
@@ -4,65 +4,68 @@ export const _AppMockJsonKey = 'APP_GLOBAL_MOCK_JSON';
|
||||
|
||||
// 默认的应用设置
|
||||
export const DefaultAppConfigs = {
|
||||
basicConfig: {
|
||||
tokenConfig: {
|
||||
personalToken: "",
|
||||
}
|
||||
},
|
||||
loveConfig: {},
|
||||
imagesConfig: {},
|
||||
authorConfig: {},
|
||||
appConfig: {},
|
||||
pluginConfig: {
|
||||
toolsPlugin: {},
|
||||
linksSubmitPlugin: {},
|
||||
},
|
||||
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: ""
|
||||
}
|
||||
}
|
||||
basicConfig: {
|
||||
tokenConfig: {
|
||||
personalToken: "",
|
||||
}
|
||||
},
|
||||
loveConfig: {},
|
||||
imagesConfig: {},
|
||||
authorConfig: {},
|
||||
appConfig: {},
|
||||
pluginConfig: {
|
||||
toolsPlugin: {},
|
||||
linksSubmitPlugin: {},
|
||||
doubanPlugin: {
|
||||
position: 'top'
|
||||
}
|
||||
},
|
||||
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: ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取应用设置
|
||||
*/
|
||||
export const getAppConfigs = () => {
|
||||
let configs = uni.getStorageSync(_AppConfigKey)
|
||||
if (configs) return JSON.parse(configs)
|
||||
let configs = uni.getStorageSync(_AppConfigKey)
|
||||
if (configs) return JSON.parse(configs)
|
||||
|
||||
uni.setStorageSync(_AppConfigKey, JSON.stringify(DefaultAppConfigs))
|
||||
return DefaultAppConfigs;
|
||||
uni.setStorageSync(_AppConfigKey, JSON.stringify(DefaultAppConfigs))
|
||||
return DefaultAppConfigs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存应用设置
|
||||
*/
|
||||
export const setAppConfigs = (configs) => {
|
||||
uni.setStorageSync(_AppConfigKey, JSON.stringify(configs))
|
||||
uni.setStorageSync(_AppConfigKey, JSON.stringify(configs))
|
||||
}
|
||||
|
||||
|
||||
@@ -70,16 +73,16 @@ export const setAppConfigs = (configs) => {
|
||||
* 获取应用模拟数据
|
||||
*/
|
||||
export const getAppMockJson = () => {
|
||||
let json = uni.getStorageSync(_AppMockJsonKey)
|
||||
if (json) return JSON.parse(json)
|
||||
let json = uni.getStorageSync(_AppMockJsonKey)
|
||||
if (json) return JSON.parse(json)
|
||||
|
||||
uni.setStorageSync(_AppMockJsonKey, JSON.stringify({}))
|
||||
return {};
|
||||
uni.setStorageSync(_AppMockJsonKey, JSON.stringify({}))
|
||||
return {};
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存应用模拟数据
|
||||
*/
|
||||
export const setAppMockJson = (json) => {
|
||||
uni.setStorageSync(_AppMockJsonKey, JSON.stringify(json))
|
||||
}
|
||||
uni.setStorageSync(_AppMockJsonKey, JSON.stringify(json))
|
||||
}
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur