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" errmsg = "You do not hold the required role in the 'Delabs Game' Discord server"
} else if(errmsg.indexOf('Please try again') > -1) { } else if(errmsg.indexOf('Please try again') > -1) {
errmsg = "Verification failed due to high traffic. Please attempt to verify again or try later" 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 { } 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.' 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>
<div class="content-right"> <div class="content-right">
<div class="content-right-title"> <div class="content-right-title">
Boost Records Chest Boost Points
</div> </div>
<div class="line"></div> <div class="line"></div>
<div class="box-boosting-no" v-if="helpLogList == undefined || helpLogList.length <= 0"> <div class="box-boosting-no" v-if="helpLogList == undefined || helpLogList.length <= 0">
@ -130,10 +130,13 @@ export default {
// //
async getHelpBoxLog() { async getHelpBoxLog() {
if (this.$route.params.code != undefined) { if (this.$route.params.code != undefined) {
let rtoken = await checkReCaptcha("chest_share"); // let rtoken = await checkReCaptcha("chest_share");
let res = await this.$axios.post( let res = await this.$axios.post(
process.env.VUE_APP_API_URL+"/api/chest/enhance/list", 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}` } headers: { Authorization: `Bearer ${this.token}` }
} }
@ -146,23 +149,29 @@ export default {
// //
async helpBtn() { async helpBtn() {
// debugger
if(this.boxState.isopened){
//todo:
this.$showErr('chest already opened')
return
}
let address = localStorage.getItem("myAddress") let address = localStorage.getItem("myAddress")
// 3 // 3
if(this.boxState.enhanced == 0) { if(this.boxState.enhanced == 0) {
// 1 // 1
if(this.boxState.userCurrent < this.boxState.userMax) { if(this.boxState.userCurrent < this.boxState.userMax) {
// 2 // 2
if(this.boxState.chestCurrent < this.boxState.chestMax) { if(this.boxState.chestCurrent < this.boxState.chestMax) {
// 4 // 4
await this.sendEnhanceReq(this.boxCode) await this.sendEnhanceReq(this.boxCode)
} else {
this.$showErr('The chests boost count has reached the upper limit.')
}
} else { } else {
this.$showErr('Boost limit reached.') this.$showErr('Todays boost count has been exhausted.')
} }
} else { } else {
this.$showErr('Not enough boosts available.') this.$showErr('You have already boosted the chest.')
}
} else {
this.$showErr('You have already boosted the chest once.')
} }
@ -228,7 +237,11 @@ export default {
// //
async initBoxState(boxCode) { 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}` }}) 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
}
}, },
// //