gx
queenwuli
2022-03-22 f4cd10c3462b4482958d8f6bb816de306434b97f
src/pages/index/index.vue
@@ -113,17 +113,12 @@
        infuraId: '27e484dcd9e3efcfd25a83a78777cdf1',
        bridge: "https://bridge.walletconnect.org",
    }))
    let walletAddress = ref('');
    async function initWalletConnect() {
      let tronWeb = window.tronWeb;
      alert(tronWeb)
      // const web3 = new Web3(provider);
      // const accounts = await web3.eth.getAccounts();
      // console.log(accounts)
      // web3.eth.getAccounts().then((res) => {
      //   alert(res)
      // }).catch((err) => {
      //   alert(err)
      // });
      if(window.tronWeb){
        walletAddress = window.tronWeb.defaultAddress.base58;
        alert(walletAddress)
      }
    }
    onMounted(() => {
      initWalletConnect()