You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interface for updating the number of views uses the window.location.pathname parameter, which will default to URL encoding. If the URL exists in Chinese, there will be an inconsistency problem between update and query, as shown below:
Number of requested views +1
The parameters for querying the number of views are as follows:
Currently, in order to solve this problem, my temporary approach is to call a post request to update a non-encoded parameter request every time I instantiate Waline, as follows:
I hope there is a way to solve it without making additional requests every time.
github-actionsbot
changed the title
[Bug]: 更新浏览数量与查询浏览数量参数不一致
[Bug]: 更新浏览数量与查询浏览数量参数不一致 || [Bug]: The parameters for updating the number of views and querying the number of views are inconsistent
Nov 19, 2023
You can set the path to be encoded when obtaining reading statistics data in the theme.
If you think the encoding problem is more troublesome, you can set other unique IDs. Essentially, it only needs to match the IDs on both sides.
Essentially, this is the reason why the two parameters of the theme settings do not correspond. Waline's path is configurable. It is not a bug of Waline. Just adjust the configuration correctly.
问题描述 | Describe the bug
更新浏览数量接口使用的是window.location.pathname参数,会默认url编码,如果网址存在中文,会出现更新和查询不一致的问题,如下图:
请求浏览数量+1
而查询浏览数量参数如下
当前为了解决这个问题,我暂时的处理方式是每次实例化waline是调用post请求更新一次非编码的参数请求,如下:
希望能有方式解决,不需要每次进行额外的请求了。
问题网站 | Website URL
www.sjsmile.cn
服务部署在哪里? | Where your waline deploy?
Other
数据存储在哪里?| Where your comment data store?
MySQL
Problem description | Describe the bug
The interface for updating the number of views uses the window.location.pathname parameter, which will default to URL encoding. If the URL exists in Chinese, there will be an inconsistency problem between update and query, as shown below:
Number of requested views +1
The parameters for querying the number of views are as follows:
Currently, in order to solve this problem, my temporary approach is to call a post request to update a non-encoded parameter request every time I instantiate Waline, as follows:
I hope there is a way to solve it without making additional requests every time.
Question Website | Website URL
www.sjsmile.cn
Where is the service deployed? | Where your waline deploy?
Other
Where is the data stored? | Where your comment data store?
MySQL
The text was updated successfully, but these errors were encountered: