Enhance mini program environment configuration and chapter loading logic
- Introduced a debugging environment configuration in app.js, allowing for dynamic API endpoint selection based on the environment. - Implemented lazy loading for chapter parts in chapters.js, improving performance by only fetching necessary data. - Updated UI elements in chapters.wxml to reflect changes in chapter loading and added loading indicators. - Enhanced error handling and data management for chapter retrieval, ensuring a smoother user experience. - Added functionality for switching API environments in settings.js, visible only in development mode.
This commit is contained in:
@@ -261,6 +261,8 @@ func Setup(cfg *config.Config) *gin.Engine {
|
||||
miniprogram.POST("/qrcode", handler.MiniprogramQrcode)
|
||||
miniprogram.GET("/qrcode/image", handler.MiniprogramQrcodeImage)
|
||||
miniprogram.GET("/book/all-chapters", handler.BookAllChapters)
|
||||
miniprogram.GET("/book/parts", handler.BookParts)
|
||||
miniprogram.GET("/book/chapters-by-part", handler.BookChaptersByPart)
|
||||
miniprogram.GET("/book/chapter/:id", handler.BookChapterByID)
|
||||
miniprogram.GET("/book/chapter/by-mid/:mid", handler.BookChapterByMID)
|
||||
miniprogram.GET("/book/hot", handler.BookHot)
|
||||
|
||||
Reference in New Issue
Block a user