Skip to content

Commit

Permalink
fix: 修复H5获取路径多一个?
Browse files Browse the repository at this point in the history
  • Loading branch information
三少 committed Aug 5, 2021
1 parent a0abae8 commit 3b65ae3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/trace/src/h5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ function appLaunch() {
}
cache.appOpts = {
path: window.location.pathname.slice(1),
query: window.location.search ? parse(window.location.search) : {},
query: window.location.search ? parse(window.location.search.slice(1)) : {},
}
}

Expand All @@ -368,7 +368,9 @@ function appHide() {
function pageLoad() {
setCommonTrackData()
const route = window.location.pathname.slice(1)
const options = window.location.search ? parse(window.location.search) : {}
const options = window.location.search
? parse(window.location.search.slice(1))
: {}
// 缓存上一个页面的数据以及上一个页面的停留时长
const now = Date.now()
const prt = (now - cache.pageShowStartTime).toString()
Expand Down

0 comments on commit 3b65ae3

Please # to comment.