|
@@ -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,
|