websocket.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /**
  2. * WebSocket配置文件
  3. *
  4. * @author kxmall
  5. * @date 2025-01-08
  6. */
  7. export default {
  8. // WebSocket连接配置
  9. connection: {
  10. // 最大重连次数
  11. maxReconnectAttempts: 5,
  12. // 重连间隔(毫秒)
  13. reconnectInterval: 5000,
  14. // 心跳间隔(毫秒)
  15. heartbeatInterval: 30000,
  16. // 连接超时时间(毫秒)
  17. connectionTimeout: 10000
  18. },
  19. // 消息通知配置
  20. notification: {
  21. // 是否启用声音提醒
  22. enableSound: true,
  23. // 是否启用震动提醒
  24. enableVibration: true,
  25. // 是否启用Toast通知
  26. enableToast: true,
  27. // 紧急订单是否使用模态框
  28. urgentOrderModal: true,
  29. // Toast显示时长(毫秒)
  30. toastDuration: 3000,
  31. // 震动时长(毫秒)
  32. vibrationDuration: 500
  33. },
  34. // 消息类型配置
  35. messageTypes: {
  36. // 新订单消息
  37. newOrder: {
  38. type: 'NEW_ORDER',
  39. title: '新订单通知',
  40. sound: true,
  41. vibration: true,
  42. autoRefresh: true
  43. },
  44. // 订单取消消息
  45. orderCancel: {
  46. type: 'ORDER_CANCEL',
  47. title: '订单取消',
  48. sound: false,
  49. vibration: false,
  50. autoRefresh: true
  51. },
  52. // 订单状态更新
  53. orderStatusUpdate: {
  54. type: 'ORDER_STATUS_UPDATE',
  55. title: '订单状态更新',
  56. sound: false,
  57. vibration: false,
  58. autoRefresh: true
  59. },
  60. // 系统消息
  61. systemMessage: {
  62. type: 'SYSTEM_MESSAGE',
  63. title: '系统消息',
  64. sound: false,
  65. vibration: false,
  66. autoRefresh: false
  67. }
  68. },
  69. // 开发环境配置
  70. development: {
  71. // 是否启用调试日志
  72. enableDebugLog: true,
  73. // 是否启用性能监控
  74. enablePerformanceMonitor: false,
  75. // 测试模式
  76. testMode: false
  77. },
  78. // 生产环境配置
  79. production: {
  80. // 是否启用调试日志
  81. enableDebugLog: false,
  82. // 是否启用性能监控
  83. enablePerformanceMonitor: true,
  84. // 测试模式
  85. testMode: false
  86. }
  87. };