feat(usage): 使用统计纳入未登录访客 — 任意工具页打开即上报(router afterEach+localStorage 10min去重+beacon), 后台总次数显示其中未登录N次+用户排行新增未登录访客行+工具名回退目录名
This commit is contained in:
1 parent
15d21235cd
commit
cd4b324740
4 files changed
+69
-5
No files matched your search
@@ -4,6 +4,7 @@ import HomePage from './pages/Home.page.vue';
|
||||
import NotFound from './pages/404.page.vue';
|
||||
import { tools } from './tools';
|
||||
import { config } from './config';
|
||||
import { reportToolUsage } from './tools/license/license';
|
||||
import { routes as demoRoutes } from './ui/demo/demo.routes';
|
||||
|
||||
const toolsRoutes = tools.map(({ path, name, component, ...config }) => ({
|
||||
@@ -58,4 +59,11 @@ const router = createRouter({
|
||||
],
|
||||
});
|
||||
|
||||
// 打开任意工具页即上报一次使用(未登录访客同样统计,见 license.ts reportToolUsage)
|
||||
router.afterEach((to) => {
|
||||
if (to.meta?.isTool) {
|
||||
reportToolUsage(String(to.path));
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
Reference in new issue
Block a user