Browse Source

update:更新体育

xiaolin.fu 6 months ago
parent
commit
2a7a341f77
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/app/[locale]/(TabBar)/sports/SportsClient.tsx

+ 5 - 0
src/app/[locale]/(TabBar)/sports/SportsClient.tsx

@@ -41,16 +41,20 @@ const SportsClient: FC<Props> = (props) => {
   }, []);
   
   useEffect(() => {
+    console.log('onLoad=====>222222')
     // 如果token更新了才调用update
     if( currentToken !== token){
+      console.log('onLoad=====> 33333')
       updateToken(token);
     }
   }, [token]);
 
   const updateToken = (newToken: string) => {
+    console.log('onLoad=====> 更新token')
     // @ts-ignore
       if(currentToken!== newToken){
         setCurrentToken(newToken);
+        console.log('onLoad=====> 回到首页')
         // 多次点击当前页面只需要跳转到首页即可
         // 使用 updateOptions 更新当前的 BTRenderer 参数,而不是重新初始化
         if (btRef.current) {
@@ -91,6 +95,7 @@ const SportsClient: FC<Props> = (props) => {
     // @ts-ignore
     const bt = new BTRenderer();
     btRef.current = bt;
+    console.log("onLoad=====> onloadToken",token);
     // @ts-ignore
     bt.initialize({
         brand_id: brand_id,