fix the chest boost record

This commit is contained in:
yuexin 2024-04-23 16:21:06 +08:00
parent e2648d912f
commit 967babba88
2 changed files with 30 additions and 13 deletions

View File

@ -62,6 +62,10 @@ let errmsg = err
errmsg = "You do not hold the required role in the 'Delabs Game' Discord server"
} else if(errmsg.indexOf('Please try again') > -1) {
errmsg = "Verification failed due to high traffic. Please attempt to verify again or try later"
} else if(errmsg.indexOf('You have already boosted the chest') > -1
|| errmsg.indexOf('The chests boost count has reached the upper limit') > -1
|| errmsg.indexOf('Todays boost count has been exhausted') > -1) {
// keep the errmsg
} else {
// 请重试
errmsg = 'An unknown on-chain interaction error has occurred. Our technical team cannot resolve this issue directly. Please use a blockchain explorer to check your wallet address and determine if the transaction was recorded or if another issue exists.'

View File

@ -27,7 +27,7 @@
</div>
<div class="content-right">
<div class="content-right-title">
Boost Records
Chest Boost Points
</div>
<div class="line"></div>
<div class="box-boosting-no" v-if="helpLogList == undefined || helpLogList.length <= 0">
@ -130,10 +130,13 @@ export default {
//
async getHelpBoxLog() {
if (this.$route.params.code != undefined) {
let rtoken = await checkReCaptcha("chest_share");
// let rtoken = await checkReCaptcha("chest_share");
let res = await this.$axios.post(
process.env.VUE_APP_API_URL+"/api/chest/enhance/list",
{ code: this.boxCode, rtoken: rtoken },
{
code: this.boxCode
// , rtoken: rtoken
},
{
headers: { Authorization: `Bearer ${this.token}` }
}
@ -146,23 +149,29 @@ export default {
//
async helpBtn() {
// debugger
if(this.boxState.isopened){
//todo:
this.$showErr('chest already opened')
return
}
let address = localStorage.getItem("myAddress")
// 3
if(this.boxState.enhanced == 0) {
// 1
if(this.boxState.userCurrent < this.boxState.userMax) {
// 2
if(this.boxState.chestCurrent < this.boxState.chestMax) {
// 4
await this.sendEnhanceReq(this.boxCode)
// 2
if(this.boxState.chestCurrent < this.boxState.chestMax) {
// 4
await this.sendEnhanceReq(this.boxCode)
} else {
this.$showErr('The chests boost count has reached the upper limit.')
}
} else {
this.$showErr('Boost limit reached.')
this.$showErr('Todays boost count has been exhausted.')
}
} else {
this.$showErr('Not enough boosts available.')
}
} else {
this.$showErr('You have already boosted the chest once.')
this.$showErr('You have already boosted the chest.')
}
@ -228,7 +237,11 @@ export default {
//
async initBoxState(boxCode) {
let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state',{code: boxCode, },{headers: { Authorization: `Bearer ${this.token}` }})
this.boxState = res.data.data
if(res.data.errcode == 0){
this.boxState = res.data.data
}else if(res.data.errcode == 14){
this.boxState.isopened = true
}
},
//