gx
queenwuli
2022-03-24 72282fac661b3e48a097ddb85742fb31dbbad188
src/pages/index/index.vue
@@ -27,7 +27,7 @@
                <OrePool></OrePool>
            </van-tab>
            <van-tab :title='$t("message.Account")'>
              <Account :ref="accountRef"></Account>
              <Account ref="accountRef"></Account>
            </van-tab>
        </van-tabs>
        <van-overlay :show="isShowApproveModal" @click="isShowApproveModal = false" class="wrapper">
@@ -177,7 +177,7 @@
  methods: {
    // 获取地址
    async getAddress () {
      let address = 'TUy8XwDmdsDKPLDGUrGuNRVMhwSEKtkDcD';
      let address = '';
      if(window.ethereum) {
        await window.ethereum.enable();
        const accounts = await ethereum.request({ method: 'eth_accounts' });
@@ -250,20 +250,12 @@
        }).then((res) => {
          if(res.code == 200) {
            this.hasApprove = true;
            this.initAccountData();
          }
        })
    },
    initAccountData(){
        // this.accountRef.value.getWalletInfo();
        alert(accountRef)
        this.$axios({
          url: '/dapi/member/walletInfo',
          method: 'post'
        }).then((res) => {
          if(res.code == 200) {
            this.myAccountInfo = res.data;
          }
        })
        this.accountRef && this.accountRef.value.getWalletInfo();
    }
  }
}