diff --git a/src/components/chain/BlockChain.js b/src/components/chain/BlockChain.js index 4fbd12f..fa7ddbf 100644 --- a/src/components/chain/BlockChain.js +++ b/src/components/chain/BlockChain.js @@ -229,6 +229,7 @@ export class BlockChain { */ async checkAndChangeChain(targetChainId, provider) { targetChainId = targetChainId || cfgChainId; + // passport只支持imtbl链, 不需要切换 if (!provider && this.store.walletType == 3) { return } @@ -238,6 +239,16 @@ export class BlockChain { console.log(`current chain: ${chainId}, want: ${targetChainId}`) chainId = await switchEthereumChain(provider.provider, targetChainId); } + + if (this.store.walletType == 3) { + const { provider, accounts } = await this.eoaWallet.web3Provider(); + this.eoaProvider = provider; + } else { + const { provider, accounts } = await this.wallet.web3Provider(); + this.web3Provider = provider; + this.eoaProvider = provider; + } + } async checkPassportLogin() {