UpdateConstants.ets 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * 更新相关常量配置
  3. */
  4. export class UpdateConstants {
  5. /**
  6. * 更新日志URL
  7. * 可以根据需要修改为你的更新日志地址
  8. */
  9. static readonly UPDATE_LOG_URL: string = 'https://static.ss5.xyz/files/update_log.html';
  10. /**
  11. * 备用更新日志URL(当主URL无法访问时使用)
  12. */
  13. static readonly BACKUP_UPDATE_LOG_URL: string = 'https://gitee.com/your-repo/raw/master/CHANGELOG.md';
  14. /**
  15. * 本地更新日志文件路径(可选,用于离线显示)
  16. */
  17. static readonly LOCAL_CHANGELOG_PATH: string = 'rawfile/changelog.html';
  18. /**
  19. * 更新日志缓存时间(毫秒)
  20. */
  21. static readonly CACHE_DURATION: number = 24 * 60 * 60 * 1000; // 24小时
  22. /**
  23. * 网络请求超时时间(毫秒)
  24. */
  25. static readonly REQUEST_TIMEOUT: number = 10000; // 10秒
  26. /**
  27. * 是否启用更新日志功能
  28. */
  29. static readonly ENABLE_UPDATE_LOG: boolean = true;
  30. /**
  31. * 是否在每次启动时都检查更新日志
  32. */
  33. static readonly CHECK_ON_EVERY_LAUNCH: boolean = true;
  34. /**
  35. * 更新日志弹窗显示延迟时间(毫秒)
  36. */
  37. static readonly DIALOG_SHOW_DELAY: number = 1500;
  38. /**
  39. * 应用版本号(手动维护,每次更新时修改此值)
  40. * 这是一个简单可靠的版本管理方案
  41. */
  42. static readonly APP_VERSION: string = '2.1.0';
  43. /**
  44. * 构建时间戳(用于区分不同的构建版本)
  45. */
  46. static readonly BUILD_TIMESTAMP: string = Date.now().toString();
  47. }