Skip to content

Commit

Permalink
fix(getCurrentPagePath): 兼容字节跳动小程序
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Aug 25, 2020
1 parent 6f3fb02 commit 7c33241
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mp/getCurrentPagePath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export function getCurrentPagePath(): string {
return ensureInMiniProgram(() => {
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const path = `/${currentPage.route}`.replace(/\/{2,}/g, '/')
const path = `/${
currentPage.route || /* 字节跳动 */ currentPage.__route__
}`.replace(/\/{2,}/g, '/')
return path
})
}

0 comments on commit 7c33241

Please sign in to comment.