diff --git a/info.php b/info.php index 0612ef1..0255c57 100644 --- a/info.php +++ b/info.php @@ -7,7 +7,7 @@ $apiBaseUrl = 'https://um.com'; $token = '你的tocken'; $websiteId = '你的网站id'; $cacheFile = 'umami_cache.json'; -$cacheTime = 600; // 缓存时间为10分钟(600秒) +$cacheTime = 604800; // 缓存时间为7天(604800秒) // 获取当前时间戳(毫秒级) $currentTimestamp = time() * 1000; diff --git a/readme.md b/readme.md index 0e1f1ac..eab7958 100644 --- a/readme.md +++ b/readme.md @@ -139,12 +139,42 @@ const BOOKED_STATUS = { 4. 保持价格系数的合理性 ## 更新日志 +### 2025-08-05 +- 优化缓存策略:将info.php中的缓存时间从10分钟(600秒)延长至7天(604800秒) +- 提升系统性能,减少API调用频率 + ### 2024-02-29 - 初始版本发布 - 实现动态定价系统 - 添加广告位预览功能 - 优化移动端显示效果 +## 维护说明 +umami的升级后会导致token丢失,需要定期的去获取新的token,否则会导致无法获取到实时的访问量数据。 +token获取:POST /api/auth/login +``` +{ + "username": "your-username", + "password": "your-password" +} +``` +如果成功,你应该得到以下类似的响应: +``` +{ + "token": "eyTMjU2IiwiY...4Q0JDLUhWxnIjoiUE_A", + "user": { + "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "username": "admin", + "role": "admin", + "createdAt": "2000-00-00T00:00:00.000Z", + "isAdmin": true + } +} +``` +- 定期更新访问量数据接口 +- 监控系统运行状态 +- 及时处理异常情况 + ## 未来计划 - 可在线支付的自助广告系统,绑定对应广告位的动态码,实现全程自助下单并完成广告投放。