From b4d09efcc9cf6a8b37a5427ac08bd10a7a66f041 Mon Sep 17 00:00:00 2001 From: linju Date: Fri, 25 Oct 2024 20:55:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E8=A7=A3=E5=86=B3APP?= =?UTF-8?q?=E7=AB=AF=E4=B8=8D=E6=94=AF=E6=8C=81console.time=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E6=96=B9=E4=BE=BF=E8=AE=A1=E6=97=B6?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/App.vue b/App.vue index 395f9ac..b7e483d 100644 --- a/App.vue +++ b/App.vue @@ -4,7 +4,32 @@ //2. 导入uniIm import uniIm from '@/uni_modules/uni-im/sdk/index.js'; // 3.引入扩展插件(项目默认引入了,扩展插件uniImMsgReader用于展示消息是否已读) - import MsgReaderExtension from '@/uni_modules/uni-im-msg-reader/extension.js' + import MsgReaderExtension from '@/uni_modules/uni-im-msg-reader/extension.js' + + // 解决APP端不支持console.time的问题 + const consoleTimeObj = {} + console.time = function (name) { + consoleTimeObj[name] = Date.now() + } + console.timeEnd = function (name,fun) { + const time = Date.now() - consoleTimeObj[name] + if (time > 0) { + // if (time > 3) { + // console.error(name + ':', time + 'ms') + // }else if(time > 1){ + // console.warn(name + ':', time + 'ms') + // } + // else{ + // console.log(name + ':', time + 'ms') + // } + + // // fun && fun(time) + // // console.log('find-'+this.constructor.name,new Error().stack) + } else { + // console.log(name + ':', time + 'ms') + } + } + export default { onLaunch: async function() { console.log('App Launch'); -- GitLab