fix: encodeURIComponent text

This commit is contained in:
Gabe Yuan
2024-04-17 23:44:53 +08:00
parent 9455670e80
commit 5880d85b48

View File

@@ -232,7 +232,7 @@ const genGemini = ({ text, from, to, url, key, prompt, model }) => {
prompt = prompt prompt = prompt
.replaceAll(INPUT_PLACE_FROM, from) .replaceAll(INPUT_PLACE_FROM, from)
.replaceAll(INPUT_PLACE_TO, to) .replaceAll(INPUT_PLACE_TO, to)
.replaceAll(INPUT_PLACE_TEXT, text); .replaceAll(INPUT_PLACE_TEXT, encodeURIComponent(text));
const data = { const data = {
contents: [ contents: [
@@ -284,7 +284,7 @@ const genCustom = ({ text, from, to, url, key, customOption = "" }) => {
.replaceAll(INPUT_PLACE_URL, url) .replaceAll(INPUT_PLACE_URL, url)
.replaceAll(INPUT_PLACE_FROM, from) .replaceAll(INPUT_PLACE_FROM, from)
.replaceAll(INPUT_PLACE_TO, to) .replaceAll(INPUT_PLACE_TO, to)
.replaceAll(INPUT_PLACE_TEXT, text) .replaceAll(INPUT_PLACE_TEXT, encodeURIComponent(text))
.replaceAll(INPUT_PLACE_KEY, key); .replaceAll(INPUT_PLACE_KEY, key);
const data = { const data = {
text, text,