浏览代码

feat: 处理报错

huangzhichao 1 年之前
父节点
当前提交
56d2d8446a
共有 1 个文件被更改,包括 1 次插入1 次删除
  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
     } = adData
 
-    const userCode = Taro.$global.userCode || Taro.getStorageSync('userCode') || ''
+    const userCode = Taro?.$global?.userCode || Taro.getStorageSync('userCode') || ''
 
     return {
       adpCode: trafficCode,