Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit b54d37a

Browse files
authored
Merge pull request #8 from chengpeiquan/develop
Develop
2 parents c708542 + fedb707 commit b54d37a

File tree

7 files changed

+9
-60
lines changed

7 files changed

+9
-60
lines changed

dist/vue-cnzz-analytics.js

Lines changed: 2 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-cnzz-analytics.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-cnzz-analytics.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-cnzz-analytics.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-cnzz-analytics",
3-
"version": "2.0.1",
3+
"version": "2.0.3",
44
"description": "A data collection tool that supports reporting of single-page application data built by Vue 3.0 & 2.0 & VuePress, based on cnzz statistics.",
55
"main": "dist/vue-cnzz-analytics.min.js",
66
"types": "vue-cnzz-analytics.d.ts",

src/main.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import PushCNZZ from '@m/pushCNZZ'
22
import getVueVersion from '@m/getVueVersion'
3-
import getRouterMode from '@m/getRouterMode'
43

54
/**
65
* 定义插件
@@ -51,15 +50,8 @@ export default function install (Vue: Vue, { router, siteIdList, isDebug = false
5150
* 路由切换时执行PV上报
5251
*/
5352
router.afterEach( (to: To) => {
54-
// 根据Vue版本获取路由模式
55-
const ROUTER_MODE: string = getRouterMode(VUE_VERSION, router);
56-
57-
// 获取页面的url信息
58-
const PAGE_PATH_DIR_COUNT: number = window.location.pathname.split('/').length;
59-
const PAGE_PATH: string = window.location.pathname.split('/').slice(0, PAGE_PATH_DIR_COUNT - 1).join('/');
60-
61-
// 根据路由模式生成要上报的链接
62-
const PAGE_URL: string = ROUTER_MODE === 'hash' ? `${PAGE_PATH}/#${to.fullPath}` : `${PAGE_PATH}${to.fullPath}`;
53+
// 获取要上报的链接(当前版本不需要拼接了)
54+
const PAGE_URL: string = window.location.href;
6355

6456
// 上报数据
6557
pushCNZZ.pv(PAGE_URL);

src/modules/getRouterMode.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)