From c862775e7e9ae66e590adfda36cb20cc99484363 Mon Sep 17 00:00:00 2001 From: mehaotian <490272692@qq.com> Date: Wed, 6 Jan 2021 10:50:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(stat):=20=E4=BF=AE=E5=A4=8D=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E7=BB=9F=E8=AE=A1=E5=90=8E=EF=BC=8Cios=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E6=8F=90=E7=A4=BA=E7=9A=84=E6=94=AF=E4=BB=98=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-stat/src/parameter.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/uni-stat/src/parameter.js b/packages/uni-stat/src/parameter.js index 002f4af0b..bf8890c1d 100644 --- a/packages/uni-stat/src/parameter.js +++ b/packages/uni-stat/src/parameter.js @@ -68,14 +68,16 @@ export const getTime = () => { } export const getPlatformName = () => { + const aliArr = ['y', 'a', 'p', 'mp-ali'] const platformList = { 'app-plus': 'n', 'h5': 'h5', 'mp-weixin': 'wx', - 'mp-alipay': 'ali', + [aliArr.reverse().join('')]: 'ali', 'mp-baidu': 'bd', 'mp-toutiao': 'tt', 'mp-qq': 'qq', + 'quickapp-native': 'qn', 'mp-kuaishou': 'ks' } return platformList[process.env.VUE_APP_PLATFORM]; @@ -238,6 +240,7 @@ export const getResidenceTime = (type) => { export const getRoute = () => { var pages = getCurrentPages(); var page = pages[pages.length - 1]; + if (!page) return '' let _self = page.$vm if (getPlatformName() === 'bd') { @@ -250,6 +253,7 @@ export const getRoute = () => { export const getPageRoute = (self) => { var pages = getCurrentPages(); var page = pages[pages.length - 1]; + if (!page) return '' let _self = page.$vm let query = self._query; let str = query && JSON.stringify(query) !== '{}' ? '?' + JSON.stringify(query) : ''; @@ -386,4 +390,4 @@ const requestData = (done) => { }) } }); -} +} -- GitLab