Skip to content

Commit

Permalink
fix: message @ replace \n.
Browse files Browse the repository at this point in the history
  • Loading branch information
Horbin-Magician committed Apr 15, 2024
1 parent 913a938 commit 7f5f18a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions front-end/src/pages/SecretPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@
}

function onUpdateMessage(){
updateMessage(msg_board_text.value).then(data => {
let update_message = msg_board_text.value
update_message = update_message.replace(/\n/g, "@");
updateMessage(update_message).then(data => {
if(data && data.status === '0') {
message.success("留言成功!");
showMsgBoardModal.value = false;
Expand All @@ -107,7 +109,7 @@
if(data && data.status === '0') {
data = data.data
secret_state.value = parseInt(data.state)
msg_board_text.value = data.message
msg_board_text.value = data.message.replace(/@/g, "\n");
secret = data.secret

if(secret_state.value === -1) {
Expand Down

0 comments on commit 7f5f18a

Please sign in to comment.