Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

网址中有中文字符时,计数器读取异常 #63

Closed
XiongLiding opened this issue Dec 10, 2020 · 3 comments
Closed

网址中有中文字符时,计数器读取异常 #63

XiongLiding opened this issue Dec 10, 2020 · 3 comments

Comments

@XiongLiding
Copy link

XiongLiding commented Dec 10, 2020

数据库里存的是 encodeURIComponent 之后的值
image
id=2 那个是我测试时改成中文的,改完后就能正常显示数据,但新数据还是会新建一个 id=5 那条去。

查询时查的是 decodeURIComponent 之后的值
image

@lizheming
Copy link
Collaborator

那可能是读取这块有点问题,是否有页面给我我这边看一下?

@XiongLiding
Copy link
Author

@lizheming
Copy link
Collaborator

查了下原因是更新统计的时候使用的是编码后的 URL,而读取的时候会做解编码的相关操作导致的,目前已针对更新操作也做了解码操作。

注意,该修改会对这种场景下的评论数据展示也会有影响,老的数据因为 URL 路径不匹配可能会无法展示。如需要老数据的可能需要统一对老数据进行下 URL 解码操作。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants