@reglow/reglow 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +267 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/reglow/common/errors.d.ts +92 -0
- package/dist/reglow/common/errors.js +127 -0
- package/dist/reglow/common/errors.js.map +1 -0
- package/dist/reglow/common/exception_handler.d.ts +14 -0
- package/dist/reglow/common/exception_handler.js +135 -0
- package/dist/reglow/common/exception_handler.js.map +1 -0
- package/dist/reglow/common/i18n.d.ts +15 -0
- package/dist/reglow/common/i18n.js +61 -0
- package/dist/reglow/common/i18n.js.map +1 -0
- package/dist/reglow/common/middleware.d.ts +5 -0
- package/dist/reglow/common/middleware.js +131 -0
- package/dist/reglow/common/middleware.js.map +1 -0
- package/dist/reglow/common/response.d.ts +28 -0
- package/dist/reglow/common/response.js +42 -0
- package/dist/reglow/common/response.js.map +1 -0
- package/dist/reglow/common/serialize.d.ts +6 -0
- package/dist/reglow/common/serialize.js +39 -0
- package/dist/reglow/common/serialize.js.map +1 -0
- package/dist/reglow/common/utils/date_utils.d.ts +10 -0
- package/dist/reglow/common/utils/date_utils.js +30 -0
- package/dist/reglow/common/utils/date_utils.js.map +1 -0
- package/dist/reglow/common/utils/parse-user-agent.d.ts +11 -0
- package/dist/reglow/common/utils/parse-user-agent.js +80 -0
- package/dist/reglow/common/utils/parse-user-agent.js.map +1 -0
- package/dist/reglow/common/utils/string_utils.d.ts +14 -0
- package/dist/reglow/common/utils/string_utils.js +31 -0
- package/dist/reglow/common/utils/string_utils.js.map +1 -0
- package/dist/reglow/core/auth.d.ts +15 -0
- package/dist/reglow/core/auth.js +184 -0
- package/dist/reglow/core/auth.js.map +1 -0
- package/dist/reglow/core/cache.d.ts +6 -0
- package/dist/reglow/core/cache.js +15 -0
- package/dist/reglow/core/cache.js.map +1 -0
- package/dist/reglow/core/config.d.ts +45 -0
- package/dist/reglow/core/config.js +83 -0
- package/dist/reglow/core/config.js.map +1 -0
- package/dist/reglow/core/data_scope.d.ts +21 -0
- package/dist/reglow/core/data_scope.js +20 -0
- package/dist/reglow/core/data_scope.js.map +1 -0
- package/dist/reglow/core/database.d.ts +4 -0
- package/dist/reglow/core/database.js +43 -0
- package/dist/reglow/core/database.js.map +1 -0
- package/dist/reglow/core/email.d.ts +12 -0
- package/dist/reglow/core/email.js +277 -0
- package/dist/reglow/core/email.js.map +1 -0
- package/dist/reglow/core/entities.d.ts +462 -0
- package/dist/reglow/core/entities.js +6 -0
- package/dist/reglow/core/entities.js.map +1 -0
- package/dist/reglow/core/fastify.d.ts +21 -0
- package/dist/reglow/core/fastify.js +2 -0
- package/dist/reglow/core/fastify.js.map +1 -0
- package/dist/reglow/core/logging.d.ts +8 -0
- package/dist/reglow/core/logging.js +32 -0
- package/dist/reglow/core/logging.js.map +1 -0
- package/dist/reglow/core/models.d.ts +98 -0
- package/dist/reglow/core/models.js +57 -0
- package/dist/reglow/core/models.js.map +1 -0
- package/dist/reglow/core/observability.d.ts +17 -0
- package/dist/reglow/core/observability.js +92 -0
- package/dist/reglow/core/observability.js.map +1 -0
- package/dist/reglow/core/payment.d.ts +107 -0
- package/dist/reglow/core/payment.js +1177 -0
- package/dist/reglow/core/payment.js.map +1 -0
- package/dist/reglow/core/plugin.d.ts +19 -0
- package/dist/reglow/core/plugin.js +85 -0
- package/dist/reglow/core/plugin.js.map +1 -0
- package/dist/reglow/core/rate_limit.d.ts +2 -0
- package/dist/reglow/core/rate_limit.js +28 -0
- package/dist/reglow/core/rate_limit.js.map +1 -0
- package/dist/reglow/core/redis.d.ts +30 -0
- package/dist/reglow/core/redis.js +278 -0
- package/dist/reglow/core/redis.js.map +1 -0
- package/dist/reglow/core/redis_keys.d.ts +22 -0
- package/dist/reglow/core/redis_keys.js +59 -0
- package/dist/reglow/core/redis_keys.js.map +1 -0
- package/dist/reglow/core/security.d.ts +25 -0
- package/dist/reglow/core/security.js +64 -0
- package/dist/reglow/core/security.js.map +1 -0
- package/dist/reglow/core/session.d.ts +17 -0
- package/dist/reglow/core/session.js +194 -0
- package/dist/reglow/core/session.js.map +1 -0
- package/dist/reglow/core/sms.d.ts +19 -0
- package/dist/reglow/core/sms.js +33 -0
- package/dist/reglow/core/sms.js.map +1 -0
- package/dist/reglow/core/storage.d.ts +45 -0
- package/dist/reglow/core/storage.js +249 -0
- package/dist/reglow/core/storage.js.map +1 -0
- package/dist/reglow/modules/agreement/controller.d.ts +7 -0
- package/dist/reglow/modules/agreement/controller.js +242 -0
- package/dist/reglow/modules/agreement/controller.js.map +1 -0
- package/dist/reglow/modules/agreement/repository.d.ts +30 -0
- package/dist/reglow/modules/agreement/repository.js +160 -0
- package/dist/reglow/modules/agreement/repository.js.map +1 -0
- package/dist/reglow/modules/agreement/router.d.ts +13 -0
- package/dist/reglow/modules/agreement/router.js +10 -0
- package/dist/reglow/modules/agreement/router.js.map +1 -0
- package/dist/reglow/modules/agreement/schema.d.ts +30 -0
- package/dist/reglow/modules/agreement/schema.js +27 -0
- package/dist/reglow/modules/agreement/schema.js.map +1 -0
- package/dist/reglow/modules/agreement/service.d.ts +42 -0
- package/dist/reglow/modules/agreement/service.js +349 -0
- package/dist/reglow/modules/agreement/service.js.map +1 -0
- package/dist/reglow/modules/ai/controller.d.ts +25 -0
- package/dist/reglow/modules/ai/controller.js +1143 -0
- package/dist/reglow/modules/ai/controller.js.map +1 -0
- package/dist/reglow/modules/ai/router.d.ts +9 -0
- package/dist/reglow/modules/ai/router.js +7 -0
- package/dist/reglow/modules/ai/router.js.map +1 -0
- package/dist/reglow/modules/ai/schema.d.ts +48 -0
- package/dist/reglow/modules/ai/schema.js +40 -0
- package/dist/reglow/modules/ai/schema.js.map +1 -0
- package/dist/reglow/modules/ai/service.d.ts +8 -0
- package/dist/reglow/modules/ai/service.js +137 -0
- package/dist/reglow/modules/ai/service.js.map +1 -0
- package/dist/reglow/modules/article/controller.d.ts +6 -0
- package/dist/reglow/modules/article/controller.js +204 -0
- package/dist/reglow/modules/article/controller.js.map +1 -0
- package/dist/reglow/modules/article/repository.d.ts +37 -0
- package/dist/reglow/modules/article/repository.js +184 -0
- package/dist/reglow/modules/article/repository.js.map +1 -0
- package/dist/reglow/modules/article/router.d.ts +10 -0
- package/dist/reglow/modules/article/router.js +8 -0
- package/dist/reglow/modules/article/router.js.map +1 -0
- package/dist/reglow/modules/article/schema.d.ts +66 -0
- package/dist/reglow/modules/article/schema.js +66 -0
- package/dist/reglow/modules/article/schema.js.map +1 -0
- package/dist/reglow/modules/article/service.d.ts +81 -0
- package/dist/reglow/modules/article/service.js +254 -0
- package/dist/reglow/modules/article/service.js.map +1 -0
- package/dist/reglow/modules/auth/controller.d.ts +6 -0
- package/dist/reglow/modules/auth/controller.js +127 -0
- package/dist/reglow/modules/auth/controller.js.map +1 -0
- package/dist/reglow/modules/auth/router.d.ts +9 -0
- package/dist/reglow/modules/auth/router.js +7 -0
- package/dist/reglow/modules/auth/router.js.map +1 -0
- package/dist/reglow/modules/auth/schema.d.ts +59 -0
- package/dist/reglow/modules/auth/schema.js +56 -0
- package/dist/reglow/modules/auth/schema.js.map +1 -0
- package/dist/reglow/modules/auth/service.d.ts +69 -0
- package/dist/reglow/modules/auth/service.js +492 -0
- package/dist/reglow/modules/auth/service.js.map +1 -0
- package/dist/reglow/modules/config/controller.d.ts +7 -0
- package/dist/reglow/modules/config/controller.js +297 -0
- package/dist/reglow/modules/config/controller.js.map +1 -0
- package/dist/reglow/modules/config/repository.d.ts +17 -0
- package/dist/reglow/modules/config/repository.js +88 -0
- package/dist/reglow/modules/config/repository.js.map +1 -0
- package/dist/reglow/modules/config/router.d.ts +13 -0
- package/dist/reglow/modules/config/router.js +8 -0
- package/dist/reglow/modules/config/router.js.map +1 -0
- package/dist/reglow/modules/config/schema.d.ts +37 -0
- package/dist/reglow/modules/config/schema.js +25 -0
- package/dist/reglow/modules/config/schema.js.map +1 -0
- package/dist/reglow/modules/customer_service/controller.d.ts +3 -0
- package/dist/reglow/modules/customer_service/controller.js +443 -0
- package/dist/reglow/modules/customer_service/controller.js.map +1 -0
- package/dist/reglow/modules/customer_service/document_parser.d.ts +5 -0
- package/dist/reglow/modules/customer_service/document_parser.js +84 -0
- package/dist/reglow/modules/customer_service/document_parser.js.map +1 -0
- package/dist/reglow/modules/customer_service/repository.d.ts +72 -0
- package/dist/reglow/modules/customer_service/repository.js +376 -0
- package/dist/reglow/modules/customer_service/repository.js.map +1 -0
- package/dist/reglow/modules/customer_service/router.d.ts +14 -0
- package/dist/reglow/modules/customer_service/router.js +9 -0
- package/dist/reglow/modules/customer_service/router.js.map +1 -0
- package/dist/reglow/modules/customer_service/schema.d.ts +97 -0
- package/dist/reglow/modules/customer_service/schema.js +91 -0
- package/dist/reglow/modules/customer_service/schema.js.map +1 -0
- package/dist/reglow/modules/customer_service/sdk_template.html +666 -0
- package/dist/reglow/modules/customer_service/service.d.ts +92 -0
- package/dist/reglow/modules/customer_service/service.js +1642 -0
- package/dist/reglow/modules/customer_service/service.js.map +1 -0
- package/dist/reglow/modules/customer_service/ws.d.ts +29 -0
- package/dist/reglow/modules/customer_service/ws.js +182 -0
- package/dist/reglow/modules/customer_service/ws.js.map +1 -0
- package/dist/reglow/modules/dept/controller.d.ts +6 -0
- package/dist/reglow/modules/dept/controller.js +122 -0
- package/dist/reglow/modules/dept/controller.js.map +1 -0
- package/dist/reglow/modules/dept/repository.d.ts +24 -0
- package/dist/reglow/modules/dept/repository.js +140 -0
- package/dist/reglow/modules/dept/repository.js.map +1 -0
- package/dist/reglow/modules/dept/router.d.ts +9 -0
- package/dist/reglow/modules/dept/router.js +7 -0
- package/dist/reglow/modules/dept/router.js.map +1 -0
- package/dist/reglow/modules/dept/schema.d.ts +37 -0
- package/dist/reglow/modules/dept/schema.js +33 -0
- package/dist/reglow/modules/dept/schema.js.map +1 -0
- package/dist/reglow/modules/dept/service.d.ts +33 -0
- package/dist/reglow/modules/dept/service.js +88 -0
- package/dist/reglow/modules/dept/service.js.map +1 -0
- package/dist/reglow/modules/dict/controller.d.ts +5 -0
- package/dist/reglow/modules/dict/controller.js +87 -0
- package/dist/reglow/modules/dict/controller.js.map +1 -0
- package/dist/reglow/modules/dict/model.d.ts +7 -0
- package/dist/reglow/modules/dict/model.js +8 -0
- package/dist/reglow/modules/dict/model.js.map +1 -0
- package/dist/reglow/modules/dict/repository.d.ts +16 -0
- package/dist/reglow/modules/dict/repository.js +103 -0
- package/dist/reglow/modules/dict/repository.js.map +1 -0
- package/dist/reglow/modules/dict/router.d.ts +9 -0
- package/dist/reglow/modules/dict/router.js +7 -0
- package/dist/reglow/modules/dict/router.js.map +1 -0
- package/dist/reglow/modules/dict/schema.d.ts +38 -0
- package/dist/reglow/modules/dict/schema.js +37 -0
- package/dist/reglow/modules/dict/schema.js.map +1 -0
- package/dist/reglow/modules/dict/service.d.ts +15 -0
- package/dist/reglow/modules/dict/service.js +88 -0
- package/dist/reglow/modules/dict/service.js.map +1 -0
- package/dist/reglow/modules/employee/controller.d.ts +6 -0
- package/dist/reglow/modules/employee/controller.js +167 -0
- package/dist/reglow/modules/employee/controller.js.map +1 -0
- package/dist/reglow/modules/employee/repository.d.ts +22 -0
- package/dist/reglow/modules/employee/repository.js +129 -0
- package/dist/reglow/modules/employee/repository.js.map +1 -0
- package/dist/reglow/modules/employee/router.d.ts +9 -0
- package/dist/reglow/modules/employee/router.js +7 -0
- package/dist/reglow/modules/employee/router.js.map +1 -0
- package/dist/reglow/modules/employee/schema.d.ts +57 -0
- package/dist/reglow/modules/employee/schema.js +58 -0
- package/dist/reglow/modules/employee/schema.js.map +1 -0
- package/dist/reglow/modules/employee/service.d.ts +30 -0
- package/dist/reglow/modules/employee/service.js +193 -0
- package/dist/reglow/modules/employee/service.js.map +1 -0
- package/dist/reglow/modules/log/controller.d.ts +6 -0
- package/dist/reglow/modules/log/controller.js +137 -0
- package/dist/reglow/modules/log/controller.js.map +1 -0
- package/dist/reglow/modules/log/data-scope.d.ts +9 -0
- package/dist/reglow/modules/log/data-scope.js +108 -0
- package/dist/reglow/modules/log/data-scope.js.map +1 -0
- package/dist/reglow/modules/log/router.d.ts +9 -0
- package/dist/reglow/modules/log/router.js +7 -0
- package/dist/reglow/modules/log/router.js.map +1 -0
- package/dist/reglow/modules/material/controller.d.ts +3 -0
- package/dist/reglow/modules/material/controller.js +400 -0
- package/dist/reglow/modules/material/controller.js.map +1 -0
- package/dist/reglow/modules/material/repository.d.ts +37 -0
- package/dist/reglow/modules/material/repository.js +183 -0
- package/dist/reglow/modules/material/repository.js.map +1 -0
- package/dist/reglow/modules/material/router.d.ts +14 -0
- package/dist/reglow/modules/material/router.js +11 -0
- package/dist/reglow/modules/material/router.js.map +1 -0
- package/dist/reglow/modules/material/schema.d.ts +40 -0
- package/dist/reglow/modules/material/schema.js +34 -0
- package/dist/reglow/modules/material/schema.js.map +1 -0
- package/dist/reglow/modules/material/service.d.ts +85 -0
- package/dist/reglow/modules/material/service.js +292 -0
- package/dist/reglow/modules/material/service.js.map +1 -0
- package/dist/reglow/modules/menu/controller.d.ts +6 -0
- package/dist/reglow/modules/menu/controller.js +69 -0
- package/dist/reglow/modules/menu/controller.js.map +1 -0
- package/dist/reglow/modules/menu/repository.d.ts +14 -0
- package/dist/reglow/modules/menu/repository.js +37 -0
- package/dist/reglow/modules/menu/repository.js.map +1 -0
- package/dist/reglow/modules/menu/router.d.ts +9 -0
- package/dist/reglow/modules/menu/router.js +7 -0
- package/dist/reglow/modules/menu/router.js.map +1 -0
- package/dist/reglow/modules/menu/schema.d.ts +39 -0
- package/dist/reglow/modules/menu/schema.js +37 -0
- package/dist/reglow/modules/menu/schema.js.map +1 -0
- package/dist/reglow/modules/menu/service.d.ts +31 -0
- package/dist/reglow/modules/menu/service.js +89 -0
- package/dist/reglow/modules/menu/service.js.map +1 -0
- package/dist/reglow/modules/message/controller.d.ts +7 -0
- package/dist/reglow/modules/message/controller.js +260 -0
- package/dist/reglow/modules/message/controller.js.map +1 -0
- package/dist/reglow/modules/message/repository.d.ts +27 -0
- package/dist/reglow/modules/message/repository.js +145 -0
- package/dist/reglow/modules/message/repository.js.map +1 -0
- package/dist/reglow/modules/message/router.d.ts +13 -0
- package/dist/reglow/modules/message/router.js +8 -0
- package/dist/reglow/modules/message/router.js.map +1 -0
- package/dist/reglow/modules/message/schema.d.ts +39 -0
- package/dist/reglow/modules/message/schema.js +37 -0
- package/dist/reglow/modules/message/schema.js.map +1 -0
- package/dist/reglow/modules/message/service.d.ts +70 -0
- package/dist/reglow/modules/message/service.js +199 -0
- package/dist/reglow/modules/message/service.js.map +1 -0
- package/dist/reglow/modules/notice/controller.d.ts +6 -0
- package/dist/reglow/modules/notice/controller.js +123 -0
- package/dist/reglow/modules/notice/controller.js.map +1 -0
- package/dist/reglow/modules/notice/repository.d.ts +25 -0
- package/dist/reglow/modules/notice/repository.js +145 -0
- package/dist/reglow/modules/notice/repository.js.map +1 -0
- package/dist/reglow/modules/notice/router.d.ts +9 -0
- package/dist/reglow/modules/notice/router.js +7 -0
- package/dist/reglow/modules/notice/router.js.map +1 -0
- package/dist/reglow/modules/notice/schema.d.ts +23 -0
- package/dist/reglow/modules/notice/schema.js +22 -0
- package/dist/reglow/modules/notice/schema.js.map +1 -0
- package/dist/reglow/modules/notice/service.d.ts +45 -0
- package/dist/reglow/modules/notice/service.js +149 -0
- package/dist/reglow/modules/notice/service.js.map +1 -0
- package/dist/reglow/modules/payment/controller.d.ts +6 -0
- package/dist/reglow/modules/payment/controller.js +186 -0
- package/dist/reglow/modules/payment/controller.js.map +1 -0
- package/dist/reglow/modules/payment/router.d.ts +10 -0
- package/dist/reglow/modules/payment/router.js +8 -0
- package/dist/reglow/modules/payment/router.js.map +1 -0
- package/dist/reglow/modules/payment/schema.d.ts +52 -0
- package/dist/reglow/modules/payment/schema.js +43 -0
- package/dist/reglow/modules/payment/schema.js.map +1 -0
- package/dist/reglow/modules/payment/service.d.ts +28 -0
- package/dist/reglow/modules/payment/service.js +219 -0
- package/dist/reglow/modules/payment/service.js.map +1 -0
- package/dist/reglow/modules/photo/controller.d.ts +2 -0
- package/dist/reglow/modules/photo/controller.js +323 -0
- package/dist/reglow/modules/photo/controller.js.map +1 -0
- package/dist/reglow/modules/photo/controller_client.d.ts +2 -0
- package/dist/reglow/modules/photo/controller_client.js +293 -0
- package/dist/reglow/modules/photo/controller_client.js.map +1 -0
- package/dist/reglow/modules/photo/repository.d.ts +50 -0
- package/dist/reglow/modules/photo/repository.js +240 -0
- package/dist/reglow/modules/photo/repository.js.map +1 -0
- package/dist/reglow/modules/photo/router.d.ts +15 -0
- package/dist/reglow/modules/photo/router.js +10 -0
- package/dist/reglow/modules/photo/router.js.map +1 -0
- package/dist/reglow/modules/photo/schema.d.ts +69 -0
- package/dist/reglow/modules/photo/schema.js +66 -0
- package/dist/reglow/modules/photo/schema.js.map +1 -0
- package/dist/reglow/modules/photo/service.d.ts +98 -0
- package/dist/reglow/modules/photo/service.js +295 -0
- package/dist/reglow/modules/photo/service.js.map +1 -0
- package/dist/reglow/modules/post/controller.d.ts +6 -0
- package/dist/reglow/modules/post/controller.js +61 -0
- package/dist/reglow/modules/post/controller.js.map +1 -0
- package/dist/reglow/modules/post/repository.d.ts +12 -0
- package/dist/reglow/modules/post/repository.js +46 -0
- package/dist/reglow/modules/post/repository.js.map +1 -0
- package/dist/reglow/modules/post/router.d.ts +9 -0
- package/dist/reglow/modules/post/router.js +7 -0
- package/dist/reglow/modules/post/router.js.map +1 -0
- package/dist/reglow/modules/post/schema.d.ts +19 -0
- package/dist/reglow/modules/post/schema.js +18 -0
- package/dist/reglow/modules/post/schema.js.map +1 -0
- package/dist/reglow/modules/post/service.d.ts +18 -0
- package/dist/reglow/modules/post/service.js +44 -0
- package/dist/reglow/modules/post/service.js.map +1 -0
- package/dist/reglow/modules/role/controller.d.ts +6 -0
- package/dist/reglow/modules/role/controller.js +103 -0
- package/dist/reglow/modules/role/controller.js.map +1 -0
- package/dist/reglow/modules/role/repository.d.ts +22 -0
- package/dist/reglow/modules/role/repository.js +84 -0
- package/dist/reglow/modules/role/repository.js.map +1 -0
- package/dist/reglow/modules/role/router.d.ts +9 -0
- package/dist/reglow/modules/role/router.js +7 -0
- package/dist/reglow/modules/role/router.js.map +1 -0
- package/dist/reglow/modules/role/schema.d.ts +32 -0
- package/dist/reglow/modules/role/schema.js +29 -0
- package/dist/reglow/modules/role/schema.js.map +1 -0
- package/dist/reglow/modules/role/service.d.ts +22 -0
- package/dist/reglow/modules/role/service.js +72 -0
- package/dist/reglow/modules/role/service.js.map +1 -0
- package/dist/reglow/modules/user/controller.d.ts +6 -0
- package/dist/reglow/modules/user/controller.js +126 -0
- package/dist/reglow/modules/user/controller.js.map +1 -0
- package/dist/reglow/modules/user/controller_client.d.ts +2 -0
- package/dist/reglow/modules/user/controller_client.js +291 -0
- package/dist/reglow/modules/user/controller_client.js.map +1 -0
- package/dist/reglow/modules/user/repository.d.ts +12 -0
- package/dist/reglow/modules/user/repository.js +71 -0
- package/dist/reglow/modules/user/repository.js.map +1 -0
- package/dist/reglow/modules/user/router.d.ts +16 -0
- package/dist/reglow/modules/user/router.js +11 -0
- package/dist/reglow/modules/user/router.js.map +1 -0
- package/dist/reglow/modules/user/schema.d.ts +92 -0
- package/dist/reglow/modules/user/schema.js +82 -0
- package/dist/reglow/modules/user/schema.js.map +1 -0
- package/dist/reglow/modules/user/service.d.ts +43 -0
- package/dist/reglow/modules/user/service.js +311 -0
- package/dist/reglow/modules/user/service.js.map +1 -0
- package/dist/reglow/modules/video/controller.d.ts +2 -0
- package/dist/reglow/modules/video/controller.js +254 -0
- package/dist/reglow/modules/video/controller.js.map +1 -0
- package/dist/reglow/modules/video/repository.d.ts +38 -0
- package/dist/reglow/modules/video/repository.js +186 -0
- package/dist/reglow/modules/video/repository.js.map +1 -0
- package/dist/reglow/modules/video/router.d.ts +10 -0
- package/dist/reglow/modules/video/router.js +8 -0
- package/dist/reglow/modules/video/router.js.map +1 -0
- package/dist/reglow/modules/video/schema.d.ts +62 -0
- package/dist/reglow/modules/video/schema.js +61 -0
- package/dist/reglow/modules/video/schema.js.map +1 -0
- package/dist/reglow/modules/video/service.d.ts +80 -0
- package/dist/reglow/modules/video/service.js +251 -0
- package/dist/reglow/modules/video/service.js.map +1 -0
- package/dist/reglow/scripts/init-data.d.ts +44 -0
- package/dist/reglow/scripts/init-data.js +472 -0
- package/dist/reglow/scripts/init-data.js.map +1 -0
- package/dist/reglow/scripts/remove-business-menu.d.ts +1 -0
- package/dist/reglow/scripts/remove-business-menu.js +124 -0
- package/dist/reglow/scripts/remove-business-menu.js.map +1 -0
- package/dist/reglow/scripts/schema.d.ts +9 -0
- package/dist/reglow/scripts/schema.js +746 -0
- package/dist/reglow/scripts/schema.js.map +1 -0
- package/dist/reglow/scripts/sync-menu-mysql-to-sqlite.d.ts +1 -0
- package/dist/reglow/scripts/sync-menu-mysql-to-sqlite.js +304 -0
- package/dist/reglow/scripts/sync-menu-mysql-to-sqlite.js.map +1 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +162 -0
- package/dist/server.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
<!-- ReglowAdmin 智能客服 SDK(v2:支持人工坐席 + 帮助助手 + 配置化) -->
|
|
2
|
+
<script>
|
|
3
|
+
(function () {
|
|
4
|
+
// ==================== 配置(优先级:window.CS_SDK_CONFIG > 后端生成默认值) ====================
|
|
5
|
+
var _cfg = window.CS_SDK_CONFIG || {};
|
|
6
|
+
var APP_ID = _cfg.app_id || '{{APP_ID}}';
|
|
7
|
+
var WELCOME = _cfg.welcome_message || '{{WELCOME}}';
|
|
8
|
+
var API_BASE = _cfg.api_base || {{API_BASE_JS}};
|
|
9
|
+
var AGENT_KEY = _cfg.agent_key || ''; // 接入标识(页面 ?agent-key= 传入,如 2),用于路由到指定坐席
|
|
10
|
+
var VISITOR_NAME = _cfg.visitor_name || '';
|
|
11
|
+
var PRIMARY = _cfg.primary_color || '#4f46e5';
|
|
12
|
+
var STORAGE_KEY = 'reglow_cs_session_' + APP_ID;
|
|
13
|
+
|
|
14
|
+
// ==================== 状态 ====================
|
|
15
|
+
var sessionId = null;
|
|
16
|
+
var serviceMode = 'bot'; // bot | waiting | agent
|
|
17
|
+
var agentName = null;
|
|
18
|
+
var agentAvatar = null;
|
|
19
|
+
var isOpen = false;
|
|
20
|
+
var unreadCount = 0; // 收起对话框时的未读消息数(悬浮按钮角标)
|
|
21
|
+
var pendingImageUrl = null;
|
|
22
|
+
var ws = null;
|
|
23
|
+
var wsConnected = false;
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
sessionId = localStorage.getItem(STORAGE_KEY) || null;
|
|
27
|
+
} catch (e) { sessionId = null; }
|
|
28
|
+
|
|
29
|
+
// ==================== 去重 ====================
|
|
30
|
+
var oldFab = document.getElementById('reglow-cs-fab');
|
|
31
|
+
if (oldFab) oldFab.remove();
|
|
32
|
+
var oldChat = document.getElementById('reglow-cs-chat');
|
|
33
|
+
if (oldChat) oldChat.remove();
|
|
34
|
+
|
|
35
|
+
// ==================== 悬浮按钮 ====================
|
|
36
|
+
var fab = document.createElement('div');
|
|
37
|
+
fab.id = 'reglow-cs-fab';
|
|
38
|
+
fab.innerHTML = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/></svg>';
|
|
39
|
+
fab.style.cssText = 'position:fixed;right:20px;bottom:20px;width:56px;height:56px;border-radius:50%;background:' + PRIMARY + ';box-shadow:0 4px 12px rgba(79,70,229,0.4);cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:99999;user-select:none;touch-action:none;';
|
|
40
|
+
fab.draggable = false;
|
|
41
|
+
fab.ondragstart = function () { return false; };
|
|
42
|
+
document.body.appendChild(fab);
|
|
43
|
+
|
|
44
|
+
// 未读消息角标(右上角红色数字)
|
|
45
|
+
var unreadBadge = document.createElement('span');
|
|
46
|
+
unreadBadge.style.cssText = 'position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;border-radius:9px;background:#ef4444;color:#fff;font-size:11px;font-weight:600;line-height:18px;text-align:center;padding:0 5px;box-sizing:border-box;display:none;';
|
|
47
|
+
fab.appendChild(unreadBadge);
|
|
48
|
+
function updateUnread() {
|
|
49
|
+
if (!unreadBadge) return;
|
|
50
|
+
if (unreadCount > 0 && !isOpen) {
|
|
51
|
+
unreadBadge.style.display = 'block';
|
|
52
|
+
unreadBadge.textContent = unreadCount > 99 ? '99+' : String(unreadCount);
|
|
53
|
+
} else {
|
|
54
|
+
unreadBadge.style.display = 'none';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function clearUnread() {
|
|
58
|
+
unreadCount = 0;
|
|
59
|
+
updateUnread();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 拖拽逻辑
|
|
63
|
+
var isDragging = false;
|
|
64
|
+
var dragStartX = 0, dragStartY = 0, fabStartX = 0, fabStartY = 0, hasDragged = false;
|
|
65
|
+
function getFabPos() { var r = fab.getBoundingClientRect(); return { left: r.left, top: r.top }; }
|
|
66
|
+
function onDragStart(cx, cy) {
|
|
67
|
+
isDragging = true; hasDragged = false;
|
|
68
|
+
var p = getFabPos(); fabStartX = p.left; fabStartY = p.top;
|
|
69
|
+
dragStartX = cx; dragStartY = cy;
|
|
70
|
+
fab.style.transition = 'none';
|
|
71
|
+
}
|
|
72
|
+
function onDragMove(cx, cy) {
|
|
73
|
+
if (!isDragging) return;
|
|
74
|
+
var dx = cx - dragStartX, dy = cy - dragStartY;
|
|
75
|
+
if (Math.abs(dx) > 4 || Math.abs(dy) > 4) hasDragged = true;
|
|
76
|
+
var nl = Math.max(0, Math.min(window.innerWidth - 56, fabStartX + dx));
|
|
77
|
+
var nt = Math.max(0, Math.min(window.innerHeight - 56, fabStartY + dy));
|
|
78
|
+
fab.style.left = nl + 'px'; fab.style.top = nt + 'px';
|
|
79
|
+
fab.style.right = 'auto'; fab.style.bottom = 'auto';
|
|
80
|
+
}
|
|
81
|
+
function onDragEnd() { isDragging = false; fab.style.transition = 'transform 0.2s'; }
|
|
82
|
+
fab.addEventListener('mousedown', function (e) { onDragStart(e.clientX, e.clientY); e.preventDefault(); });
|
|
83
|
+
document.addEventListener('mousemove', function (e) { onDragMove(e.clientX, e.clientY); });
|
|
84
|
+
document.addEventListener('mouseup', onDragEnd);
|
|
85
|
+
fab.addEventListener('touchstart', function (e) { var t = e.touches[0]; onDragStart(t.clientX, t.clientY); }, { passive: true });
|
|
86
|
+
document.addEventListener('touchmove', function (e) { var t = e.touches[0]; onDragMove(t.clientX, t.clientY); }, { passive: true });
|
|
87
|
+
document.addEventListener('touchend', onDragEnd);
|
|
88
|
+
|
|
89
|
+
// ==================== 聊天窗口 ====================
|
|
90
|
+
var chatBox = document.createElement('div');
|
|
91
|
+
chatBox.id = 'reglow-cs-chat';
|
|
92
|
+
chatBox.style.cssText = 'position:fixed;right:20px;bottom:90px;width:380px;max-width:calc(100vw - 40px);height:560px;max-height:calc(100vh - 120px);background:white;border-radius:16px;box-shadow:0 8px 32px rgba(0,0,0,0.15);display:none;flex-direction:column;overflow:hidden;z-index:99999;font-family:system-ui,-apple-system,sans-serif;';
|
|
93
|
+
chatBox.innerHTML = '\
|
|
94
|
+
<div id="reglow-cs-header" style="padding:14px 16px;background:' + PRIMARY + ';color:white;display:flex;align-items:center;gap:10px;flex-shrink:0;">\
|
|
95
|
+
<span id="reglow-cs-agent-avatar" style="width:28px;height:28px;border-radius:50%;background:rgba(255,255,255,0.25);display:none;align-items:center;justify-content:center;font-size:13px;font-weight:600;">客</span>\
|
|
96
|
+
<span id="reglow-cs-title" style="font-size:15px;font-weight:600;">在线客服</span>\
|
|
97
|
+
<span id="reglow-cs-subtitle" style="font-size:11px;opacity:0.85;"></span>\
|
|
98
|
+
<span id="reglow-cs-close" style="margin-left:auto;cursor:pointer;font-size:20px;line-height:1;">×</span>\
|
|
99
|
+
</div>\
|
|
100
|
+
<div id="reglow-cs-messages" style="flex:1;overflow-y:auto;padding:16px;background:#f5f5f5;"></div>\
|
|
101
|
+
<div id="reglow-cs-preview" style="display:none;padding:0 12px 4px;border-top:1px solid #e0e0e0;"></div>\
|
|
102
|
+
<div id="reglow-cs-quick" style="display:none;padding:8px 12px;border-top:1px solid #e0e0e0;text-align:center;"></div>\
|
|
103
|
+
<div style="padding:8px 12px 12px;border-top:1px solid #e0e0e0;display:flex;gap:8px;align-items:center;flex-shrink:0;">\
|
|
104
|
+
<label style="cursor:pointer;display:flex;align-items:center;flex-shrink:0;">\
|
|
105
|
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#666" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>\
|
|
106
|
+
<input id="reglow-cs-file" type="file" accept="image/*" style="display:none;" />\
|
|
107
|
+
</label>\
|
|
108
|
+
<input id="reglow-cs-input" type="text" placeholder="请输入您的问题..." style="flex:1;padding:10px 14px;border:1px solid #ddd;border-radius:8px;font-size:14px;outline:none;" />\
|
|
109
|
+
<button id="reglow-cs-send" style="padding:10px 14px;background:' + PRIMARY + ';color:white;border:none;border-radius:8px;cursor:pointer;font-size:14px;flex-shrink:0;">发送</button>\
|
|
110
|
+
<button id="reglow-cs-transfer" title="转人工" style="padding:10px 12px;background:white;color:' + PRIMARY + ';border:1px solid ' + PRIMARY + ';border-radius:8px;cursor:pointer;font-size:13px;flex-shrink:0;display:none;">人工</button>\
|
|
111
|
+
</div>';
|
|
112
|
+
document.body.appendChild(chatBox);
|
|
113
|
+
|
|
114
|
+
var headerEl = chatBox.querySelector('#reglow-cs-header');
|
|
115
|
+
var titleEl = chatBox.querySelector('#reglow-cs-title');
|
|
116
|
+
var subtitleEl = chatBox.querySelector('#reglow-cs-subtitle');
|
|
117
|
+
var agentAvatarEl = chatBox.querySelector('#reglow-cs-agent-avatar');
|
|
118
|
+
var messagesEl = chatBox.querySelector('#reglow-cs-messages');
|
|
119
|
+
var quickEl = chatBox.querySelector('#reglow-cs-quick');
|
|
120
|
+
var inputEl = chatBox.querySelector('#reglow-cs-input');
|
|
121
|
+
var sendBtn = chatBox.querySelector('#reglow-cs-send');
|
|
122
|
+
var transferBtn = chatBox.querySelector('#reglow-cs-transfer');
|
|
123
|
+
var fileInput = chatBox.querySelector('#reglow-cs-file');
|
|
124
|
+
var previewEl = chatBox.querySelector('#reglow-cs-preview');
|
|
125
|
+
|
|
126
|
+
// ==================== 工具函数 ====================
|
|
127
|
+
function renderMarkdown(text) {
|
|
128
|
+
var html = String(text || '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
129
|
+
html = html.replace(/```(\w*)\n([\s\S]*?)```/g, '<pre style="background:#f0f0f0;padding:8px;border-radius:6px;font-size:13px;overflow-x:auto;"><code>$2</code></pre>');
|
|
130
|
+
html = html.replace(/`([^`]+)`/g, '<code style="background:#f0f0f0;padding:1px 4px;border-radius:3px;font-size:13px;">$1</code>');
|
|
131
|
+
html = html.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>');
|
|
132
|
+
html = html.replace(/\*(.+?)\*/g, '<em>$1</em>');
|
|
133
|
+
html = html.replace(/^### (.+)$/gm, '<strong style="font-size:15px;">$1</strong>');
|
|
134
|
+
html = html.replace(/^## (.+)$/gm, '<strong style="font-size:16px;">$1</strong>');
|
|
135
|
+
html = html.replace(/^# (.+)$/gm, '<strong style="font-size:17px;">$1</strong>');
|
|
136
|
+
html = html.replace(/^[\-\*] (.+)$/gm, '• $1');
|
|
137
|
+
html = html.replace(/^\d+\. (.+)$/gm, '$1');
|
|
138
|
+
html = html.replace(/\n\n/g, '<br><br>');
|
|
139
|
+
html = html.replace(/\n/g, '<br>');
|
|
140
|
+
html = html.replace(/^---$/gm, '<hr style="border:none;border-top:1px solid #ddd;margin:8px 0;">');
|
|
141
|
+
return html;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// 消息时间(HH:MM)
|
|
145
|
+
function formatTime(ts) {
|
|
146
|
+
var d = ts ? new Date(String(ts).replace(' ', 'T')) : new Date();
|
|
147
|
+
if (isNaN(d.getTime())) d = new Date();
|
|
148
|
+
var pad = function (n) { return n < 10 ? '0' + n : '' + n; };
|
|
149
|
+
return pad(d.getHours()) + ':' + pad(d.getMinutes());
|
|
150
|
+
}
|
|
151
|
+
// 消息昵称
|
|
152
|
+
function roleLabel(role, name) {
|
|
153
|
+
if (role === 'user') return VISITOR_NAME || '我';
|
|
154
|
+
if (role === 'assistant') return 'AI';
|
|
155
|
+
return name || '客服';
|
|
156
|
+
}
|
|
157
|
+
// 昵称+时间(气泡上方,头像右侧)
|
|
158
|
+
function makeMsgHeader(role, name, time) {
|
|
159
|
+
var el = document.createElement('div');
|
|
160
|
+
el.style.cssText = 'font-size:10px;color:#999;line-height:1.3;margin-bottom:2px;white-space:nowrap;';
|
|
161
|
+
el.textContent = roleLabel(role, name) + ' · ' + formatTime(time);
|
|
162
|
+
return el;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function makeAvatar(role, name) {
|
|
166
|
+
var avatar = document.createElement('div');
|
|
167
|
+
avatar.style.cssText = 'width:32px;height:32px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600;color:#fff;' +
|
|
168
|
+
(role === 'user' ? 'background:#10b981;' : 'background:' + PRIMARY + ';');
|
|
169
|
+
if (role === 'user') {
|
|
170
|
+
avatar.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>';
|
|
171
|
+
} else {
|
|
172
|
+
var label = name ? name.charAt(0) : '助';
|
|
173
|
+
avatar.textContent = label;
|
|
174
|
+
}
|
|
175
|
+
return avatar;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function addTextMessage(role, content, name, time) {
|
|
179
|
+
var div = document.createElement('div');
|
|
180
|
+
div.style.cssText = 'margin-bottom:12px;display:flex;align-items:flex-start;gap:8px;' +
|
|
181
|
+
(role === 'user' ? 'justify-content:flex-end;' : 'justify-content:flex-start;');
|
|
182
|
+
if (role !== 'user') div.appendChild(makeAvatar(role, name));
|
|
183
|
+
// 头像右侧列:昵称+时间(上) + 气泡(下);flex:1 给出确定宽度基准,气泡宽度随内容
|
|
184
|
+
var col = document.createElement('div');
|
|
185
|
+
col.style.cssText = 'min-width:0;flex:1;display:flex;flex-direction:column;align-items:' +
|
|
186
|
+
(role === 'user' ? 'flex-end' : 'flex-start') + ';';
|
|
187
|
+
col.appendChild(makeMsgHeader(role, name, time));
|
|
188
|
+
var bubble = document.createElement('div');
|
|
189
|
+
bubble.style.cssText = 'max-width:75%;width:fit-content;padding:10px 14px;border-radius:12px;font-size:14px;line-height:1.6;word-break:break-word;' +
|
|
190
|
+
(role === 'user' ? 'background:' + PRIMARY + ';color:white;' : 'background:white;color:#333;border:1px solid #e0e0e0;');
|
|
191
|
+
if (role === 'user') {
|
|
192
|
+
bubble.textContent = content;
|
|
193
|
+
} else {
|
|
194
|
+
bubble.innerHTML = renderMarkdown(content);
|
|
195
|
+
// AI 回复下挂"转人工"快捷入口
|
|
196
|
+
if (role === 'assistant' && serviceMode === 'bot') appendQuickTransfer(bubble);
|
|
197
|
+
}
|
|
198
|
+
col.appendChild(bubble);
|
|
199
|
+
div.appendChild(col);
|
|
200
|
+
if (role === 'user') div.appendChild(makeAvatar('user'));
|
|
201
|
+
messagesEl.appendChild(div);
|
|
202
|
+
messagesEl.scrollTop = messagesEl.scrollHeight;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function addImageMessage(role, imageUrl, time) {
|
|
206
|
+
var div = document.createElement('div');
|
|
207
|
+
div.style.cssText = 'margin-bottom:12px;display:flex;align-items:flex-start;gap:8px;' +
|
|
208
|
+
(role === 'user' ? 'justify-content:flex-end;' : 'justify-content:flex-start;');
|
|
209
|
+
if (role !== 'user') div.appendChild(makeAvatar(role));
|
|
210
|
+
var col = document.createElement('div');
|
|
211
|
+
col.style.cssText = 'min-width:0;flex:1;display:flex;flex-direction:column;align-items:' +
|
|
212
|
+
(role === 'user' ? 'flex-end' : 'flex-start') + ';';
|
|
213
|
+
col.appendChild(makeMsgHeader(role, '', time));
|
|
214
|
+
var bubble = document.createElement('div');
|
|
215
|
+
bubble.style.cssText = 'max-width:75%;width:fit-content;border-radius:12px;overflow:hidden;' + (role === 'user' ? '' : 'border:1px solid #e0e0e0;');
|
|
216
|
+
var img = document.createElement('img');
|
|
217
|
+
img.src = API_BASE + imageUrl;
|
|
218
|
+
img.style.cssText = 'max-width:100%;max-height:200px;display:block;cursor:pointer;';
|
|
219
|
+
img.onclick = function () { window.open(img.src, '_blank'); };
|
|
220
|
+
bubble.appendChild(img);
|
|
221
|
+
col.appendChild(bubble);
|
|
222
|
+
div.appendChild(col);
|
|
223
|
+
if (role === 'user') div.appendChild(makeAvatar('user'));
|
|
224
|
+
messagesEl.appendChild(div);
|
|
225
|
+
messagesEl.scrollTop = messagesEl.scrollHeight;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function addSystemMessage(content) {
|
|
229
|
+
var div = document.createElement('div');
|
|
230
|
+
div.style.cssText = 'text-align:center;margin:8px 0;';
|
|
231
|
+
div.innerHTML = '<div style="display:inline-block;background:#e8e8e8;padding:6px 14px;border-radius:12px;font-size:12px;color:#666;max-width:90%;">' + renderMarkdown(content) + '</div>';
|
|
232
|
+
messagesEl.appendChild(div);
|
|
233
|
+
messagesEl.scrollTop = messagesEl.scrollHeight;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function addTyping() {
|
|
237
|
+
var div = document.createElement('div');
|
|
238
|
+
div.id = 'reglow-cs-typing';
|
|
239
|
+
div.style.cssText = 'margin-bottom:12px;display:flex;align-items:flex-start;gap:8px;justify-content:flex-start;';
|
|
240
|
+
div.appendChild(makeAvatar('assistant'));
|
|
241
|
+
var bubble = document.createElement('div');
|
|
242
|
+
bubble.style.cssText = 'padding:10px 14px;border-radius:12px;background:white;border:1px solid #e0e0e0;font-size:14px;color:#999;';
|
|
243
|
+
bubble.textContent = '正在思考...';
|
|
244
|
+
div.appendChild(bubble);
|
|
245
|
+
messagesEl.appendChild(div);
|
|
246
|
+
messagesEl.scrollTop = messagesEl.scrollHeight;
|
|
247
|
+
}
|
|
248
|
+
function removeTyping() { var el = document.getElementById('reglow-cs-typing'); if (el) el.remove(); }
|
|
249
|
+
|
|
250
|
+
// ==================== 状态显示 ====================
|
|
251
|
+
function updateHeader() {
|
|
252
|
+
titleEl.textContent = serviceMode === 'agent' ? '人工坐席' : '在线客服';
|
|
253
|
+
subtitleEl.textContent = serviceMode === 'agent' && agentName ? agentName : '';
|
|
254
|
+
if (serviceMode === 'agent' && agentName) {
|
|
255
|
+
agentAvatarEl.style.display = 'flex';
|
|
256
|
+
agentAvatarEl.textContent = agentName.charAt(0);
|
|
257
|
+
if (agentAvatar) agentAvatarEl.style.backgroundImage = 'url(' + agentAvatar + ')';
|
|
258
|
+
} else {
|
|
259
|
+
agentAvatarEl.style.display = 'none';
|
|
260
|
+
}
|
|
261
|
+
transferBtn.style.display = (serviceMode === 'bot') ? 'block' : 'none';
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function appendQuickTransfer(bubbleEl) {
|
|
265
|
+
var link = document.createElement('div');
|
|
266
|
+
link.style.cssText = 'margin-top:8px;font-size:12px;color:' + PRIMARY + ';cursor:pointer;text-align:right;';
|
|
267
|
+
link.textContent = '转人工客服 →';
|
|
268
|
+
link.onclick = function () { requestTransfer(); };
|
|
269
|
+
bubbleEl.appendChild(link);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// ==================== 转人工 ====================
|
|
273
|
+
function requestTransfer() {
|
|
274
|
+
if (serviceMode !== 'bot') return;
|
|
275
|
+
transferBtn.disabled = true;
|
|
276
|
+
addSystemMessage('正在为您接入人工坐席...');
|
|
277
|
+
fetch(API_BASE + '/api/v1/cs/transfer', {
|
|
278
|
+
method: 'POST',
|
|
279
|
+
headers: { 'Content-Type': 'application/json' },
|
|
280
|
+
body: JSON.stringify({
|
|
281
|
+
app_id: APP_ID,
|
|
282
|
+
session_id: sessionId,
|
|
283
|
+
agent_key: AGENT_KEY || undefined,
|
|
284
|
+
visitor_name: VISITOR_NAME || undefined,
|
|
285
|
+
})
|
|
286
|
+
}).then(function (res) { return res.json(); }).then(function (res) {
|
|
287
|
+
transferBtn.disabled = false;
|
|
288
|
+
if (res.code === 0 && res.data) {
|
|
289
|
+
var d = res.data;
|
|
290
|
+
serviceMode = 'waiting';
|
|
291
|
+
addSystemMessage(d.message || '已接入人工服务');
|
|
292
|
+
if (d.session_id) { sessionId = d.session_id; persistSession(); }
|
|
293
|
+
if (d.agent_id) {
|
|
294
|
+
serviceMode = 'agent';
|
|
295
|
+
agentName = d.agent_name || '客服';
|
|
296
|
+
agentAvatar = d.agent_avatar || null;
|
|
297
|
+
updateHeader();
|
|
298
|
+
}
|
|
299
|
+
connectWS();
|
|
300
|
+
} else {
|
|
301
|
+
serviceMode = 'bot';
|
|
302
|
+
addSystemMessage(res.msg || '转人工失败,请稍后再试');
|
|
303
|
+
updateHeader();
|
|
304
|
+
}
|
|
305
|
+
}).catch(function () {
|
|
306
|
+
transferBtn.disabled = false;
|
|
307
|
+
serviceMode = 'bot';
|
|
308
|
+
addSystemMessage('网络异常,转人工失败,请稍后再试');
|
|
309
|
+
updateHeader();
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
transferBtn.onclick = requestTransfer;
|
|
313
|
+
|
|
314
|
+
// ==================== WebSocket(接收坐席消息) ====================
|
|
315
|
+
function wsBase() {
|
|
316
|
+
var base = API_BASE || '';
|
|
317
|
+
if (base.indexOf('https://') === 0) return 'wss://' + base.slice(8);
|
|
318
|
+
if (base.indexOf('http://') === 0) return 'ws://' + base.slice(7);
|
|
319
|
+
return (location.protocol === 'https:' ? 'wss://' : 'ws://') + location.host;
|
|
320
|
+
}
|
|
321
|
+
var wsSessionId = null; // WS 绑定的会话ID(会话切换时需重连)
|
|
322
|
+
function connectWS() {
|
|
323
|
+
if (!sessionId) return;
|
|
324
|
+
// 会话ID变化(如结束后重新咨询开启新会话)时,断开旧连接并重连
|
|
325
|
+
if (ws && ws.readyState === WebSocket.OPEN && wsSessionId === sessionId) return;
|
|
326
|
+
try { if (ws) { ws.onclose = null; try { ws.close(); } catch (e) {} ws = null; wsConnected = false; } } catch (e) {}
|
|
327
|
+
try {
|
|
328
|
+
ws = new WebSocket(wsBase() + '/api/v1/cs/ws/user?session_id=' + encodeURIComponent(sessionId));
|
|
329
|
+
wsSessionId = sessionId;
|
|
330
|
+
ws.onopen = function () { wsConnected = true; };
|
|
331
|
+
ws.onmessage = function (ev) {
|
|
332
|
+
try { handleWSEvent(JSON.parse(ev.data)); } catch (e) {}
|
|
333
|
+
};
|
|
334
|
+
ws.onclose = function () { wsConnected = false; ws = null; };
|
|
335
|
+
ws.onerror = function () { try { ws && ws.close(); } catch (e) {} };
|
|
336
|
+
} catch (e) {}
|
|
337
|
+
}
|
|
338
|
+
function handleWSEvent(msg) {
|
|
339
|
+
if (msg.type === 'agent_message') {
|
|
340
|
+
removeTyping();
|
|
341
|
+
serviceMode = 'agent';
|
|
342
|
+
if (msg.agent_name && agentName !== msg.agent_name) { agentName = msg.agent_name; updateHeader(); }
|
|
343
|
+
// 收起对话框时累计未读数,悬浮按钮角标提示
|
|
344
|
+
if (!isOpen) { unreadCount++; updateUnread(); }
|
|
345
|
+
addTextMessage('agent', msg.content, msg.agent_name || '客服', msg.created_at);
|
|
346
|
+
} else if (msg.type === 'agent_online') {
|
|
347
|
+
serviceMode = 'agent';
|
|
348
|
+
agentName = msg.agent_name || '客服';
|
|
349
|
+
agentAvatar = msg.agent_avatar || null;
|
|
350
|
+
updateHeader();
|
|
351
|
+
addSystemMessage('已为您接入人工坐席 ' + agentName);
|
|
352
|
+
} else if (msg.type === 'session_closed') {
|
|
353
|
+
serviceMode = 'bot';
|
|
354
|
+
agentName = null; agentAvatar = null;
|
|
355
|
+
updateHeader();
|
|
356
|
+
addSystemMessage(msg.content || '本次人工服务已结束,感谢您的咨询');
|
|
357
|
+
showRating();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// ==================== 满意度评价 ====================
|
|
362
|
+
function showRating() {
|
|
363
|
+
if (!sessionId || document.getElementById('reglow-cs-rating')) return;
|
|
364
|
+
var div = document.createElement('div');
|
|
365
|
+
div.id = 'reglow-cs-rating';
|
|
366
|
+
div.style.cssText = 'text-align:center;margin:10px 0;';
|
|
367
|
+
div.innerHTML =
|
|
368
|
+
'<div style="display:inline-block;background:white;border:1px solid #e0e0e0;border-radius:12px;padding:10px 16px;max-width:90%;">' +
|
|
369
|
+
'<div style="font-size:13px;color:#444;margin-bottom:6px;">请评价本次人工服务</div>' +
|
|
370
|
+
'<div style="display:flex;justify-content:center;gap:4px;">' +
|
|
371
|
+
'<span class="reglow-cs-star" data-v="1" style="cursor:pointer;font-size:22px;color:#d1d5db;">★</span>' +
|
|
372
|
+
'<span class="reglow-cs-star" data-v="2" style="cursor:pointer;font-size:22px;color:#d1d5db;">★</span>' +
|
|
373
|
+
'<span class="reglow-cs-star" data-v="3" style="cursor:pointer;font-size:22px;color:#d1d5db;">★</span>' +
|
|
374
|
+
'<span class="reglow-cs-star" data-v="4" style="cursor:pointer;font-size:22px;color:#d1d5db;">★</span>' +
|
|
375
|
+
'<span class="reglow-cs-star" data-v="5" style="cursor:pointer;font-size:22px;color:#d1d5db;">★</span>' +
|
|
376
|
+
'</div>' +
|
|
377
|
+
'<div style="font-size:11px;color:#999;margin-top:4px;">点击星星评分</div>' +
|
|
378
|
+
'</div>';
|
|
379
|
+
var stars = div.querySelectorAll('.reglow-cs-star');
|
|
380
|
+
for (var i = 0; i < stars.length; i++) {
|
|
381
|
+
stars[i].addEventListener('click', function () {
|
|
382
|
+
var v = parseInt(this.getAttribute('data-v'), 10);
|
|
383
|
+
submitRating(v);
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
messagesEl.appendChild(div);
|
|
387
|
+
messagesEl.scrollTop = messagesEl.scrollHeight;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function submitRating(rating) {
|
|
391
|
+
fetch(API_BASE + '/api/v1/cs/rating', {
|
|
392
|
+
method: 'POST',
|
|
393
|
+
headers: { 'Content-Type': 'application/json' },
|
|
394
|
+
body: JSON.stringify({ session_id: sessionId, rating: rating })
|
|
395
|
+
}).then(function (res) { return res.json(); }).then(function (res) {
|
|
396
|
+
var el = document.getElementById('reglow-cs-rating');
|
|
397
|
+
if (el) {
|
|
398
|
+
el.innerHTML = '<div style="display:inline-block;background:#e8f5e9;color:#2e7d32;border-radius:12px;padding:8px 16px;font-size:12px;">感谢您的评价(' + rating + ' 星)</div>';
|
|
399
|
+
}
|
|
400
|
+
}).catch(function () {});
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// ==================== 历史消息恢复 ====================
|
|
404
|
+
function loadHistory() {
|
|
405
|
+
if (!sessionId) return;
|
|
406
|
+
fetch(API_BASE + '/api/v1/cs/history?session_id=' + encodeURIComponent(sessionId))
|
|
407
|
+
.then(function (res) { return res.json(); })
|
|
408
|
+
.then(function (res) {
|
|
409
|
+
if (res.code !== 0 || !res.data || !res.data.length) return;
|
|
410
|
+
messagesEl.innerHTML = '';
|
|
411
|
+
res.data.forEach(function (m) {
|
|
412
|
+
if (m.role === 'system') { addSystemMessage(m.display_content || m.content); }
|
|
413
|
+
else if (m.role === 'user') {
|
|
414
|
+
if (m.content_type === 'image') addImageMessage('user', m.image_url, m.created_at);
|
|
415
|
+
else addTextMessage('user', m.display_content || m.content, null, m.created_at);
|
|
416
|
+
}
|
|
417
|
+
else if (m.role === 'agent') {
|
|
418
|
+
serviceMode = 'agent';
|
|
419
|
+
agentName = '客服'; updateHeader();
|
|
420
|
+
addTextMessage('agent', m.display_content || m.content, '客服', m.created_at);
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
if (m.content_type === 'image') addImageMessage('assistant', m.image_url, m.created_at);
|
|
424
|
+
else addTextMessage('assistant', m.display_content || m.content, null, m.created_at);
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
}).catch(function () {});
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// ==================== 上传图片 ====================
|
|
431
|
+
function uploadImage(file, callback) {
|
|
432
|
+
var formData = new FormData();
|
|
433
|
+
formData.append('file', file);
|
|
434
|
+
var xhr = new XMLHttpRequest();
|
|
435
|
+
xhr.open('POST', API_BASE + '/api/v1/cs/upload');
|
|
436
|
+
xhr.onload = function () {
|
|
437
|
+
if (xhr.status === 200) {
|
|
438
|
+
try {
|
|
439
|
+
var res = JSON.parse(xhr.responseText);
|
|
440
|
+
if (res.code === 0 && res.data && res.data.url) callback(null, res.data.url);
|
|
441
|
+
else callback(res.msg || '上传失败');
|
|
442
|
+
} catch (e) { callback('上传失败'); }
|
|
443
|
+
} else callback('上传失败(' + xhr.status + ')');
|
|
444
|
+
};
|
|
445
|
+
xhr.onerror = function () { callback('网络异常'); };
|
|
446
|
+
xhr.send(formData);
|
|
447
|
+
}
|
|
448
|
+
function clearPendingImage() {
|
|
449
|
+
pendingImageUrl = null;
|
|
450
|
+
previewEl.style.display = 'none';
|
|
451
|
+
previewEl.innerHTML = '';
|
|
452
|
+
}
|
|
453
|
+
function setPendingImage(url) {
|
|
454
|
+
pendingImageUrl = url;
|
|
455
|
+
var wrapper = document.createElement('div');
|
|
456
|
+
wrapper.style.cssText = 'position:relative;display:inline-block;margin:4px;';
|
|
457
|
+
var img = document.createElement('img');
|
|
458
|
+
img.src = API_BASE + url;
|
|
459
|
+
img.style.cssText = 'max-height:80px;max-width:200px;border-radius:8px;border:1px solid #ddd;';
|
|
460
|
+
wrapper.appendChild(img);
|
|
461
|
+
var closeSpan = document.createElement('span');
|
|
462
|
+
closeSpan.style.cssText = 'position:absolute;top:-4px;right:-4px;width:18px;height:18px;border-radius:50%;background:#ef4444;color:white;font-size:12px;line-height:18px;text-align:center;cursor:pointer;';
|
|
463
|
+
closeSpan.innerHTML = '×';
|
|
464
|
+
closeSpan.onclick = clearPendingImage;
|
|
465
|
+
wrapper.appendChild(closeSpan);
|
|
466
|
+
previewEl.innerHTML = '';
|
|
467
|
+
previewEl.appendChild(wrapper);
|
|
468
|
+
previewEl.style.display = 'block';
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// ==================== 发送消息 ====================
|
|
472
|
+
function persistSession() {
|
|
473
|
+
try { localStorage.setItem(STORAGE_KEY, sessionId); } catch (e) {}
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function sendMessage(question) {
|
|
477
|
+
var text = (question != null) ? String(question) : inputEl.value.trim();
|
|
478
|
+
var imgUrl = pendingImageUrl;
|
|
479
|
+
if (!text && !imgUrl) return;
|
|
480
|
+
|
|
481
|
+
if (imgUrl) { addImageMessage('user', imgUrl); clearPendingImage(); }
|
|
482
|
+
if (text) addTextMessage('user', text);
|
|
483
|
+
inputEl.value = '';
|
|
484
|
+
sendBtn.disabled = true;
|
|
485
|
+
addTyping();
|
|
486
|
+
|
|
487
|
+
var replyText = '';
|
|
488
|
+
var replyDiv = null;
|
|
489
|
+
var replyId = 'reglow-cs-reply-' + Date.now() + '-' + Math.random().toString(36).substr(2, 6);
|
|
490
|
+
|
|
491
|
+
fetch(API_BASE + '/api/v1/cs/chat', {
|
|
492
|
+
method: 'POST',
|
|
493
|
+
headers: { 'Content-Type': 'application/json' },
|
|
494
|
+
body: JSON.stringify({
|
|
495
|
+
app_id: APP_ID,
|
|
496
|
+
session_id: sessionId,
|
|
497
|
+
message: text || null,
|
|
498
|
+
image_url: imgUrl || null,
|
|
499
|
+
visitor_name: VISITOR_NAME || undefined,
|
|
500
|
+
})
|
|
501
|
+
}).then(function (response) {
|
|
502
|
+
var reader = response.body.getReader();
|
|
503
|
+
var decoder = new TextDecoder();
|
|
504
|
+
function read() {
|
|
505
|
+
reader.read().then(function (result) {
|
|
506
|
+
if (result.done) { sendBtn.disabled = false; removeTyping(); return; }
|
|
507
|
+
var txt = decoder.decode(result.value, { stream: true });
|
|
508
|
+
var lines = txt.split('\n');
|
|
509
|
+
for (var i = 0; i < lines.length; i++) {
|
|
510
|
+
var line = lines[i].trim();
|
|
511
|
+
if (!line.startsWith('data: ')) continue;
|
|
512
|
+
try {
|
|
513
|
+
var json = JSON.parse(line.substring(6));
|
|
514
|
+
if (json.type === 'session') {
|
|
515
|
+
sessionId = json.session_id;
|
|
516
|
+
persistSession();
|
|
517
|
+
connectWS();
|
|
518
|
+
} else if (json.type === 'content') {
|
|
519
|
+
if (!replyDiv) {
|
|
520
|
+
removeTyping();
|
|
521
|
+
replyDiv = document.createElement('div');
|
|
522
|
+
replyDiv.style.cssText = 'margin-bottom:12px;display:flex;align-items:flex-start;gap:8px;justify-content:flex-start;';
|
|
523
|
+
replyDiv.appendChild(makeAvatar('assistant'));
|
|
524
|
+
var replyCol = document.createElement('div');
|
|
525
|
+
replyCol.style.cssText = 'min-width:0;flex:1;display:flex;flex-direction:column;align-items:flex-start;';
|
|
526
|
+
replyCol.appendChild(makeMsgHeader('assistant', '', ''));
|
|
527
|
+
var bubble = document.createElement('div');
|
|
528
|
+
bubble.style.cssText = 'max-width:75%;width:fit-content;padding:10px 14px;border-radius:12px;background:white;color:#333;border:1px solid #e0e0e0;font-size:14px;line-height:1.6;word-break:break-word;';
|
|
529
|
+
bubble.id = replyId;
|
|
530
|
+
replyCol.appendChild(bubble);
|
|
531
|
+
replyDiv.appendChild(replyCol);
|
|
532
|
+
messagesEl.appendChild(replyDiv);
|
|
533
|
+
}
|
|
534
|
+
replyText += json.content;
|
|
535
|
+
var bubbleEl = document.getElementById(replyId);
|
|
536
|
+
if (bubbleEl) bubbleEl.innerHTML = renderMarkdown(replyText);
|
|
537
|
+
messagesEl.scrollTop = messagesEl.scrollHeight;
|
|
538
|
+
} else if (json.type === 'handled_by_agent') {
|
|
539
|
+
// 人工模式下消息已转交坐席,回复将通过 WebSocket 推送
|
|
540
|
+
removeTyping();
|
|
541
|
+
} else if (json.type === 'transfer_required') {
|
|
542
|
+
// 智能转人工:系统已自动接入坐席
|
|
543
|
+
removeTyping();
|
|
544
|
+
serviceMode = json.agent_id ? 'agent' : 'waiting';
|
|
545
|
+
if (json.agent_name) { agentName = json.agent_name; updateHeader(); }
|
|
546
|
+
addSystemMessage(json.message || '已为您转接人工坐席');
|
|
547
|
+
connectWS();
|
|
548
|
+
} else if (json.type === 'done') {
|
|
549
|
+
sendBtn.disabled = false;
|
|
550
|
+
if (replyText && replyDiv) {
|
|
551
|
+
// AI 回复下挂"转人工"快捷入口
|
|
552
|
+
if (serviceMode === 'bot') appendQuickTransfer(replyDiv.lastChild);
|
|
553
|
+
}
|
|
554
|
+
if (!replyText) removeTyping();
|
|
555
|
+
} else if (json.type === 'error') {
|
|
556
|
+
removeTyping();
|
|
557
|
+
addTextMessage('assistant', json.content);
|
|
558
|
+
sendBtn.disabled = false;
|
|
559
|
+
}
|
|
560
|
+
} catch (e) {}
|
|
561
|
+
}
|
|
562
|
+
read();
|
|
563
|
+
}).catch(function () {
|
|
564
|
+
// 流被中断(连接重置/后端重启):恢复输入并提示,避免 UI 卡死
|
|
565
|
+
sendBtn.disabled = false;
|
|
566
|
+
removeTyping();
|
|
567
|
+
if (!replyText) addTextMessage('assistant', '网络中断,请重新发送');
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
read();
|
|
571
|
+
}).catch(function () {
|
|
572
|
+
removeTyping();
|
|
573
|
+
addTextMessage('assistant', '网络异常,请稍后重试');
|
|
574
|
+
sendBtn.disabled = false;
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
sendBtn.onclick = function () { sendMessage(); };
|
|
579
|
+
inputEl.onkeydown = function (e) { if (e.key === 'Enter') sendMessage(); };
|
|
580
|
+
|
|
581
|
+
// 文件选择 -> 预览
|
|
582
|
+
fileInput.onchange = function () {
|
|
583
|
+
if (fileInput.files && fileInput.files[0]) {
|
|
584
|
+
var file = fileInput.files[0];
|
|
585
|
+
if (file.size > 5 * 1024 * 1024) { addTextMessage('assistant', '图片大小不能超过5MB'); fileInput.value = ''; return; }
|
|
586
|
+
uploadImage(file, function (err, url) {
|
|
587
|
+
if (err) addTextMessage('assistant', '图片上传失败: ' + err);
|
|
588
|
+
else setPendingImage(url);
|
|
589
|
+
fileInput.value = '';
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
// 粘贴图片 -> 预览
|
|
594
|
+
inputEl.addEventListener('paste', function (e) {
|
|
595
|
+
var items = e.clipboardData && e.clipboardData.items;
|
|
596
|
+
if (!items) return;
|
|
597
|
+
for (var i = 0; i < items.length; i++) {
|
|
598
|
+
if (items[i].type && items[i].type.indexOf('image') !== -1) {
|
|
599
|
+
e.preventDefault();
|
|
600
|
+
uploadImage(items[i].getAsFile(), function (err, url) {
|
|
601
|
+
if (err) addTextMessage('assistant', '图片上传失败: ' + err);
|
|
602
|
+
else setPendingImage(url);
|
|
603
|
+
});
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
// ==================== 窗口开关 ====================
|
|
610
|
+
fab.addEventListener('click', function () {
|
|
611
|
+
if (hasDragged) return;
|
|
612
|
+
isOpen = !isOpen;
|
|
613
|
+
chatBox.style.display = isOpen ? 'flex' : 'none';
|
|
614
|
+
if (isOpen) {
|
|
615
|
+
clearUnread();
|
|
616
|
+
if (!messagesEl.children.length) addSystemMessage(WELCOME);
|
|
617
|
+
inputEl.focus();
|
|
618
|
+
if (sessionId) { loadHistory(); connectWS(); }
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
chatBox.querySelector('#reglow-cs-close').addEventListener('click', function (e) {
|
|
622
|
+
e.stopPropagation(); e.preventDefault();
|
|
623
|
+
isOpen = false;
|
|
624
|
+
chatBox.style.display = 'none';
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
// ==================== 帮助助手模式 ====================
|
|
628
|
+
// 页面任意元素加 data-cs-question="问题文本",点击即打开客服并自动发送该问题
|
|
629
|
+
function bindHelpElements() {
|
|
630
|
+
var nodes = document.querySelectorAll('[data-cs-question]');
|
|
631
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
632
|
+
(function (node) {
|
|
633
|
+
if (node.getAttribute('data-cs-bound')) return;
|
|
634
|
+
node.setAttribute('data-cs-bound', '1');
|
|
635
|
+
var q = node.getAttribute('data-cs-question');
|
|
636
|
+
node.addEventListener('click', function (e) {
|
|
637
|
+
e.stopPropagation();
|
|
638
|
+
openChat();
|
|
639
|
+
sendMessage(q || '你好,我有一个问题想咨询');
|
|
640
|
+
});
|
|
641
|
+
})(nodes[i]);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
function openChat() {
|
|
645
|
+
isOpen = true;
|
|
646
|
+
chatBox.style.display = 'flex';
|
|
647
|
+
clearUnread();
|
|
648
|
+
if (!messagesEl.children.length) addSystemMessage(WELCOME);
|
|
649
|
+
connectWS();
|
|
650
|
+
}
|
|
651
|
+
// 暴露全局 API:window.ReglowCS.open(question)
|
|
652
|
+
try {
|
|
653
|
+
window.ReglowCS = window.ReglowCS || {};
|
|
654
|
+
window.ReglowCS.open = function (question) {
|
|
655
|
+
openChat();
|
|
656
|
+
if (question) sendMessage(question);
|
|
657
|
+
else inputEl.focus();
|
|
658
|
+
};
|
|
659
|
+
} catch (e) {}
|
|
660
|
+
|
|
661
|
+
// DOM 就绪后绑定帮助元素(含动态元素)
|
|
662
|
+
function bindLoop() { bindHelpElements(); setTimeout(bindLoop, 1500); }
|
|
663
|
+
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', bindLoop);
|
|
664
|
+
else bindLoop();
|
|
665
|
+
})();
|
|
666
|
+
</script>
|