Browse Source

feat: 处理报错

huangzhichao 1 year ago
parent
commit
56d2d8446a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/plugin/components/custom/index.tsx

+ 1 - 1
src/plugin/components/custom/index.tsx

@@ -168,7 +168,7 @@ function YLQCustom(props: PropsWithChildren<CustomPropsType>) {
       adType: ownAdSystemType
       adType: ownAdSystemType
     } = adData
     } = adData
 
 
-    const userCode = Taro.$global.userCode || Taro.getStorageSync('userCode') || ''
+    const userCode = Taro?.$global?.userCode || Taro.getStorageSync('userCode') || ''
 
 
     return {
     return {
       adpCode: trafficCode,
       adpCode: trafficCode,