修复 Umami 统计接口在新版 API 下无法显示 PV/UV 的问题#1249
Open
licyk wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fluid 当前的
umami-view.js使用的是 Umami v2 API 写法:urldata.pageviews.value和data.visitors.value但新版 Umami API 已经发生变化:
url改为path/api/websites/:websiteId/stats的返回结构从{ value, prev }改为数字值因此在使用新版 Umami 时,原有代码访问统计结果会触发错误:
或者:
这个修复增加了对新版 Umami API 的兼容,同时保留对 v2 返回结构的兼容。
参考: