更新小程序API路径,统一为/api/miniprogram前缀,确保与后端一致性。同时,调整微信支付相关配置,增强系统的灵活性和可维护性。

This commit is contained in:
乘风
2026-02-09 18:19:12 +08:00
parent 7b2123dfe5
commit e6aebeeca5
59 changed files with 5040 additions and 179 deletions

View File

@@ -22,7 +22,7 @@ class ChapterAccessManager {
*/
async fetchLatestConfig() {
try {
const res = await app.request('/api/db/config', { timeout: 3000 })
const res = await app.request('/api/miniprogram/config', { timeout: 3000 })
if (res.success && res.freeChapters) {
return {
freeChapters: res.freeChapters,
@@ -70,7 +70,7 @@ class ChapterAccessManager {
// 3. 请求服务端校验是否已购买(带重试)
const res = await this.requestWithRetry(
`/api/user/check-purchased?userId=${encodeURIComponent(userId)}&type=section&productId=${encodeURIComponent(sectionId)}`,
`/api/miniprogram/user/check-purchased?userId=${encodeURIComponent(userId)}&type=section&productId=${encodeURIComponent(sectionId)}`,
{ timeout: 5000 },
2 // 最多重试2次
)
@@ -145,7 +145,7 @@ class ChapterAccessManager {
if (!userId) return
try {
const res = await app.request(`/api/user/purchase-status?userId=${encodeURIComponent(userId)}`)
const res = await app.request(`/api/miniprogram/user/purchase-status?userId=${encodeURIComponent(userId)}`)
if (res.success && res.data) {
app.globalData.hasFullBook = res.data.hasFullBook || false