fix: the method to get account address

This commit is contained in:
snsd0805 2023-06-10 22:20:14 +08:00
parent e3f7145f91
commit 4dd0a9c1e8
Signed by: snsd0805
GPG Key ID: 569349933C77A854
3 changed files with 5 additions and 4 deletions

View File

@ -36,7 +36,7 @@ export default {
},
async mounted() {
this.web3 = new Web3(window.ethereum)
this.clientAddr = (await this.web3.eth.getAccounts())[0]
this.clientAddr = this.$cookies.get('address')
this.web3.eth.defaultAccount = this.clientAddr
this.token = new this.web3.eth.Contract(SBT, this.SBTAddress)

View File

@ -38,7 +38,7 @@ export default {
this.$router.push('/')
}
this.web3 = new Web3(window.ethereum)
this.clientAddr = (await this.web3.eth.getAccounts())[0]
this.clientAddr = this.$cookies.get('address')
this.web3.eth.defaultAccount = this.clientAddr
},
methods: {

View File

@ -26,7 +26,7 @@ export default {
},
async mounted() {
this.web3 = new Web3(window.ethereum)
this.clientAddr = (await this.web3.eth.getAccounts())[0]
this.clientAddr = this.$cookies.get('address')
this.web3.eth.defaultAccount = this.clientAddr
this.token = new this.web3.eth.Contract(SBT, this.SBTAddress)
@ -141,7 +141,8 @@ export default {
<div class="columns">
<div class="column is-2 is-offset-5">
<RouterLink to="/client" class="button is-primary is-fullwidth is-medium is-outlined">確認</RouterLink>
<p class="block">確認完成註冊請重新登入</p>
<RouterLink to="/" class="button is-primary is-fullwidth is-medium is-outlined">確認並完成註冊</RouterLink>
</div>
</div>
</div>