From 1c3f43cd1896c404e06f67ff4d88453cc82c01dc Mon Sep 17 00:00:00 2001 From: guoenxuan Date: Fri, 21 Jun 2024 10:20:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ddev=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=E6=A1=A5=E6=8E=A5=E5=88=B0=E5=8E=9F=E7=94=9F=E4=BE=A7?= =?UTF-8?q?=E7=9A=84=E5=90=8C=E6=AD=A5API=E5=B4=A9=E6=BA=83=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/apis/harmony-native/ApiCache.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/taro-platform-harmony-hybrid/src/api/apis/harmony-native/ApiCache.ts b/packages/taro-platform-harmony-hybrid/src/api/apis/harmony-native/ApiCache.ts index cf3e32dd7a83..c3302eddc3f7 100644 --- a/packages/taro-platform-harmony-hybrid/src/api/apis/harmony-native/ApiCache.ts +++ b/packages/taro-platform-harmony-hybrid/src/api/apis/harmony-native/ApiCache.ts @@ -11,7 +11,8 @@ export function syncApiCache (cacheTime: number = 500) : MethodDecorator { lastCall = now return lastResult } - lastResult = origMethod.apply(this, args) + // dev模式下origMethod为 undefined + lastResult = origMethod?.apply(this, args) lastCall = now return lastResult }