Explorar el Código

feat: 处理报错

huangzhichao hace 1 año
padre
commit
56d2d8446a
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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,