存储带有百分号的电子邮件时出现问题。

huangapple 未分类评论46阅读模式
英文:

Issue while store email store with % sign

问题

你好,我从前端将数据存储到MySQL数据库中,然后在前端检索这些数据,但在我更新电子邮件并保存后,它保存为abs%gmail.com而不是abs@gmail.com。当我第一次保存它们时没有出现任何问题,我已经从stackoverflow、git和其他来源寻找解决方案,但这些解决方案都没有奏效。

对于任何解决方案,我都会非常感激。

英文:

Hi I have store data from frontend to MySQL DB and retrieving them to frontend but after I update the email and save, it saves like abs%gmail.com instead abs@gmail.com. When I saving them for the first time no issues occur, I have looked solutions from stack overflow, git and ext. but any of those did not work.

Any solution will be generally appreciating.

答案1

得分: 0

it's encoded

simply decode it in your flow

decodeURIComponent('abs%40gmail.com') // result: "abs@gmail.com"

encodeURIComponent('abs@gmail.com') // result: "abs%40gmail.com"

英文:

it's encoded

simply decode it in your flow

decodeURIComponent('abs%40gmail.com') // result: "abs@gmail.com"

encodeURIComponent('abs@gmail.com') // result: "abs%40gmail.com"

huangapple
  • 本文由 发表于 2020年5月4日 20:50:43
  • 转载请务必保留本文链接:https://java.coder-hub.com/61592617.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定