feat: refactor application to use Gin framework, update routing and middleware handling

This commit is contained in:
王锦强
2025-03-15 12:39:17 +08:00
parent cab289dabf
commit 6fa5c1f467
13 changed files with 314 additions and 279 deletions

View File

@@ -203,20 +203,15 @@ document.addEventListener('DOMContentLoaded', function () {
// 复制HttpTTS链接按钮点击事件
copyHttpTtsLinkButton.addEventListener('click', function () {
const text = textInput.value.trim();
if (!text) {
showCustomAlert('请输入要转换的文本', 'warning');
return;
}
const text = "{{java.encodeURI(speakText)}}";
const voice = voiceSelect.value;
const style = styleSelect.value;
const rate = rateInput.value;
const rate = "{{speakSpeed*4}}"
const pitch = pitchInput.value;
const apiKey = apiKeyInput.value.trim();
// 构建HttpTTS链接
let httpTtsLink = `${window.location.origin}${config.basePath}/tts?t=${encodeURIComponent(text)}&v=${voice}&r=${rate}&p=${pitch}&s=${style}`;
let httpTtsLink = `${window.location.origin}${config.basePath}/tts?t=${text}&v=${voice}&r=${rate}&p=${pitch}&s=${style}`;
// 添加API Key参数如果有
if (apiKey) {

View File

@@ -1152,7 +1152,7 @@
<path stroke-linecap="round" stroke-linejoin="round"
d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"/>
</svg>
复制HttpTTS链接
导入阅读
</button>
</div>
</div>