同步数据
This commit is contained in:
@@ -22,17 +22,19 @@ class ChapterAccessManager {
|
||||
*/
|
||||
async fetchLatestConfig() {
|
||||
try {
|
||||
const res = await app.request({ url: '/api/miniprogram/config', silent: true, timeout: 3000 })
|
||||
if (res.success && res.prices) {
|
||||
const res = await app.getConfig()
|
||||
if (res && res.success && res.prices) {
|
||||
return {
|
||||
prices: res.prices || { section: 1, fullbook: 9.9 }
|
||||
prices: res.prices || { section: 1, fullbook: 9.9 },
|
||||
shareRate: res.shareRate != null ? res.shareRate : 90
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[AccessManager] 获取配置失败,使用默认配置:', e)
|
||||
}
|
||||
return {
|
||||
prices: { section: 1, fullbook: 9.9 }
|
||||
prices: { section: 1, fullbook: 9.9 },
|
||||
shareRate: 90
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user