Skip to content

Commit 5ab117b

Browse files
committed
修复之前只能替换一个加号的bug,同时也加上了url encode
1 parent d9afcf4 commit 5ab117b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

static/js/chat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function sendMessage() {
5555
}
5656

5757
function getAnswer(inputValue){
58-
inputValue = inputValue.replace('+', '{[$add$]}');
58+
inputValue = encodeURIComponent(inputValue.replace(/\+/g, '{[$add$]}'));
5959
const url = "./chat.php?q="+inputValue;
6060
const eventSource = new EventSource(url);
6161

0 commit comments

Comments
 (0)