From 063571a2da8999709b32d434248c85df8a57724f Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Wed, 23 Mar 2022 17:30:00 +0800
Subject: [PATCH] gx

---
 src/pages/index/index.vue |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index e6a123f..95299ca 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -27,7 +27,7 @@
                 <OrePool></OrePool>
             </van-tab>
             <van-tab :title='$t("message.Account")'>
-              <Account></Account>
+              <Account :ref="accountRef"></Account>
             </van-tab>
         </van-tabs>
         <van-overlay :show="isShowApproveModal" @click="isShowApproveModal = false" class="wrapper">
@@ -101,6 +101,7 @@
   },
   setup() {
     const { proxy } = getCurrentInstance();
+    let accountRef = ref(null);
     let walletAddress = ref('');
     let hasApprove = ref(false);
     let isShowApproveModal = ref(false);
@@ -169,7 +170,8 @@
       
       walletAddress, //地址
       hasApprove, //是否授权
-      myAccountInfo: reactive({})
+
+      accountRef
     };
   },
   methods: {
@@ -187,12 +189,12 @@
     },
     isApprove () {
         this.$axios({
-          url: '/dapp/common/isApprove/' + this.walletAddress,
+          url: '/dapi/common/isApprove/' + this.walletAddress,
           method: 'get'
         }).then((res) => {
           if(res.code == 200) {
             this.hasApprove = true;
-            this.getWalletInfo()
+            this.initAccountData()
             sessionStorage.setItem('address', this.walletAddress);
           }else{
             this.hasApprove = false;
@@ -239,7 +241,7 @@
     },
     submitApprove () {
         this.$axios({
-          url: '/dapp/common/approve',
+          url: '/dapi/common/approve',
           method: 'post',
           data: {
             address: this.walletAddress,
@@ -251,9 +253,11 @@
           }
         })
     },
-    getWalletInfo(){
+    initAccountData(){
+        // this.accountRef.value.getWalletInfo();
+        alert(accountRef)
         this.$axios({
-          url: '/dapp/member/walletInfo',
+          url: '/dapi/member/walletInfo',
           method: 'post'
         }).then((res) => {
           if(res.code == 200) {

--
Gitblit v1.9.1