diff --git a/pages/interstellareye/Registergame.vue b/pages/interstellareye/Registergame.vue index 3284832..974b798 100644 --- a/pages/interstellareye/Registergame.vue +++ b/pages/interstellareye/Registergame.vue @@ -190,28 +190,35 @@ }, success: (res) => { // console.log(res, 777777) - let token = res.data.data.userinfo.token - // 關聯錢包地址 - uni.request({ - url: 'https://www.samsaradao.com/api/user/refyzswallet', //仅为示例,并非真实接口地址。 - method: 'POST', - data: { - wallet: this.address - }, - header: { - token: token //自定义请求头信息 - }, - success: (res) => { - console.log('关联钱包地址res', res); - uni.showToast({ - title: '註冊成功!!' - }) - this.Searchregistration() - uni.switchTab({ - url: "/pages/interstellareye/interstellareye", // 注意路径 - }); - } - }); + if(res.data.code === 1){ + let token = res.data.data.userinfo.token + // 關聯錢包地址 + uni.request({ + url: 'https://www.samsaradao.com/api/user/refyzswallet', //仅为示例,并非真实接口地址。 + method: 'POST', + data: { + wallet: this.address + }, + header: { + token: token //自定义请求头信息 + }, + success: (res) => { + console.log('关联钱包地址res', res); + uni.showToast({ + title: '註冊成功!!' + }) + this.Searchregistration() + uni.switchTab({ + url: "/pages/interstellareye/interstellareye", // 注意路径 + }); + } + }); + }else{ + uni.showToast({ + title:res.data.msg, + icon:"error" + }) + } }, fail(rej) { uni.showToast({