From 374588fa3cbc2786adbccdb6caa1366ca6feb06c Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期一, 24 三月 2025 15:52:22 +0800
Subject: [PATCH] 语音朗读

---
 vite.config.ts |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/vite.config.ts b/vite.config.ts
index c8bccb9..5977664 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -58,7 +58,27 @@
 			host: '0.0.0.0',
 			port: env.VITE_PORT as unknown as number,
 			open: JSON.parse(env.VITE_OPEN),
-			hmr: false,
+			hmr: true,
+			proxy: {
+				'/events': {
+					target: 'http://localhost:3000',
+					changeOrigin: true,
+				},
+				/** @description 鐧惧害璇煶璇嗗埆 */
+				'/api/baidu/speech_recognition': {
+					target: 'https://aip.baidubce.com/rpc/2.0/tts/v1',
+					changeOrigin: true,
+				},
+				/** @description 鐧惧害璇煶鍚堟垚 */
+				'/api/baidu/speech_synthesis': {
+					target: 'https://aip.baidubce.com/rpc/2.0/tts/v1',
+					changeOrigin: true,
+					rewrite: (path) => {
+						const newPath = path.replace('/api/baidu/speech_synthesis', '');
+						return newPath;
+					},
+				},
+			},
 		},
 		build: {
 			// outDir: 'dist/' + mode.mode,

--
Gitblit v1.9.3