From 8910020e3c4dc5b3dca361446be40ec7b133c9d4 Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Fri, 25 Mar 2022 11:30:30 +0800
Subject: [PATCH] gx

---
 src/pages/index/index.vue |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index fd8b18a..3cbc142 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -118,7 +118,7 @@
         infuraId: '27e484dcd9e3efcfd25a83a78777cdf1',
         rpc: {
           1: "https://mainnet.infura.io/v3/f54a5887a3894ebb9425920701a97fe0",
-        },
+        }
       });
       await provider.enable();
       provider.on("accountsChanged", (accounts) => {
@@ -129,7 +129,6 @@
         window.location.reload();
       });
       proxy.web3 = new Web3(provider);
-      console.log(new Web3(provider))
       const accounts = await proxy.web3.eth.getAccounts();
       proxy.walletAddress = accounts[0];
       console.log('所有的账户,拿得到吗?')
@@ -250,6 +249,8 @@
         await window.ethereum.enable();
         const accounts = await ethereum.request({ method: 'eth_accounts' });
         address = accounts[0];
+        console.log('dapp环境噢')
+        console.log(accounts)
       }else if(window.tronWeb){
         address = window.tronWeb.defaultAddress.base58;
       }
@@ -290,6 +291,9 @@
         console.log('授权成功')
         console.log(res)
         this.submitApprove()
+      }).catch((err) => {
+        console.log('授权失败')
+        console.log(err)
       })
     },
     async tornWebApprove () {

--
Gitblit v1.9.1