Update: config and page logic adjustments

This commit is contained in:
zhiyun 2026-02-05 01:29:52 +08:00
parent 638f13df1f
commit 5e63193f9f
4 changed files with 35 additions and 3 deletions

View File

@ -33,7 +33,7 @@ const ENV = {
const CURRENT_ENV = 'production'
// 硬编码版本号 - 用于审核开关对比
const APP_VERSION = '1.0'
const APP_VERSION = '2.0'
// 导出配置
const config = {

View File

@ -199,6 +199,8 @@ Page({
const cdnBase = 'https://ai-c.maimanji.com/images'
this.setData({
bannerList: [
/*
// 404 Not Found
{
id: 1,
imageUrl: `${cdnBase}/service-banner-1.png`,
@ -207,6 +209,7 @@ Page({
subtitle: '',
bgColor: 'linear-gradient(135deg, #E8D5F0 0%, #F5E6D3 100%)'
},
*/
{
id: 2,
imageUrl: `${cdnBase}/service-banner-2.png`,
@ -268,6 +271,16 @@ Page({
this.setData({
auditStatus: app.globalData.auditStatus
})
// 节流处理避免频繁切换Tab导致请求过多(429)
const now = Date.now()
const lastRefreshTime = this.lastRefreshTime || 0
// 30秒内不重复刷新
if (now - lastRefreshTime < 30000) {
return
}
this.lastRefreshTime = now
this.loadUnreadCount()
},

View File

@ -49,6 +49,15 @@ Page({
// 每次显示页面时刷新数据(已登录的情况下)
const app = getApp()
if (app.globalData.isLoggedIn) {
// 节流处理避免频繁切换Tab导致请求过多(429)
const now = Date.now()
const lastRefreshTime = this.lastRefreshTime || 0
// 30秒内不重复刷新
if (now - lastRefreshTime < 30000) {
return
}
this.lastRefreshTime = now
this.loadData()
}
},
@ -506,7 +515,7 @@ Page({
const cdnBase = 'https://ai-c.maimanji.com/images'
this.setData({
posterTemplates: [
{ id: 1, imageUrl: `${cdnBase}/service-banner-1.png` },
// { id: 1, imageUrl: `${cdnBase}/service-banner-1.png` }, // 404 Not Found
{ id: 2, imageUrl: `${cdnBase}/service-banner-2.png` }
],
currentPosterIndex: 0

View File

@ -160,6 +160,16 @@ Page({
this.setData({
auditStatus: app.globalData.auditStatus
})
// 节流处理避免频繁切换Tab导致请求过多(429)
const now = Date.now()
const lastRefreshTime = this.lastRefreshTime || 0
// 30秒内不重复刷新
if (now - lastRefreshTime < 30000) {
return
}
this.lastRefreshTime = now
this.loadListData()
this.loadUnreadCount()
},
@ -200,7 +210,7 @@ Page({
const cdnBase = 'https://ai-c.maimanji.com/images'
this.setData({
banners: [
`${cdnBase}/service-banner-1.png`,
// `${cdnBase}/service-banner-1.png`, // 404 Not Found
`${cdnBase}/service-banner-2.png`,
`${cdnBase}/service-banner-3.png`,
`${cdnBase}/service-banner-4.png`,