From 445b10a97c27254b17e670991ac7d06d9e75e966 Mon Sep 17 00:00:00 2001 From: wulin Date: Fri, 20 Oct 2023 16:33:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E7=94=A8=E7=AE=97=E6=B3=95=E8=AF=AD?= =?UTF-8?q?=E9=9F=B3=E5=90=88=E6=88=90=E5=A2=9E=E5=8A=A0=E5=8F=A5=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iot-gateway/src/main/resources/bootstrap-dev.yml | 7 +++++++ .../box/websocket/api/handler/BaseWebSocketProcess.java | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/iot-gateway/src/main/resources/bootstrap-dev.yml b/iot-gateway/src/main/resources/bootstrap-dev.yml index bf1ee97..8620d88 100644 --- a/iot-gateway/src/main/resources/bootstrap-dev.yml +++ b/iot-gateway/src/main/resources/bootstrap-dev.yml @@ -37,6 +37,13 @@ spring: filters: # 转发时去掉一层路径 - StripPrefix=1 + - id: qiuguo-iot-box-websocket + uri: lb://qiuguo-iot-box-websocket + predicates: + - Path=/websocket/** + filters: + # 转发时去掉一层路径 + - StripPrefix=0 globalcors: corsConfigurations: '[/**]': diff --git a/iot-modules/iot-box-websocket-api/src/main/java/com/qiuguo/iot/box/websocket/api/handler/BaseWebSocketProcess.java b/iot-modules/iot-box-websocket-api/src/main/java/com/qiuguo/iot/box/websocket/api/handler/BaseWebSocketProcess.java index be1ac04..abf730f 100644 --- a/iot-modules/iot-box-websocket-api/src/main/java/com/qiuguo/iot/box/websocket/api/handler/BaseWebSocketProcess.java +++ b/iot-modules/iot-box-websocket-api/src/main/java/com/qiuguo/iot/box/websocket/api/handler/BaseWebSocketProcess.java @@ -683,11 +683,12 @@ public class BaseWebSocketProcess { text.startsWith("。") || text.startsWith(":") || text.startsWith(";") || - text.startsWith("《")){ + text.startsWith("《") || + text.startsWith(" ")){ //标点符号起始会导致合成的声音第一句话有杂音 text = text.substring(1); } - audioService.getAudioUrl(text).map(s ->{ + audioService.getAudioUrl(text + "。").map(s ->{ BoxMessageResp boxMessageResp = new BoxMessageResp(); BeanUtils.copyProperties(baseMessageResp, boxMessageResp); boxMessageResp.setAudio(s);