simple inviter code
This commit is contained in:
parent
78ba497647
commit
b673d2f90b
@ -70,6 +70,7 @@ import { getToken } from './../../utils/cookies.js'
|
||||
import { sendHelp } from './../../utils/chainapi.js'
|
||||
import {
|
||||
checkReCaptcha,
|
||||
apiUploadInviteCode
|
||||
} from "./../../utils/webapi.js";
|
||||
|
||||
export default {
|
||||
@ -133,11 +134,12 @@ export default {
|
||||
async helpConfirm() {
|
||||
if(this.$route.params.name != undefined) {
|
||||
let newInvite = this.$route.params.name.split("new=")[1];
|
||||
let rtoken = await checkReCaptcha("invite_user");
|
||||
let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/upload_invite_code", {
|
||||
params: { code: newInvite, rtoken: rtoken },
|
||||
headers: { Authorization: `Bearer ${this.token}` }
|
||||
});
|
||||
// let rtoken = await checkReCaptcha("invite_user");
|
||||
// let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/upload_invite_code", {
|
||||
// params: { code: newInvite, rtoken: rtoken },
|
||||
// headers: { Authorization: `Bearer ${this.token}` }
|
||||
// });
|
||||
let res = await apiUploadInviteCode(newInvite)
|
||||
if (res.data.errcode == 0) {
|
||||
this.isNewUser = 0
|
||||
} else {
|
||||
|
@ -1163,44 +1163,20 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
// 邀请新人
|
||||
async getUploadInviteCode(code) {
|
||||
await apiUploadInviteCode(code)
|
||||
return
|
||||
try {
|
||||
let { errcode, errmsg, data } = apiUploadInviteCode(code)
|
||||
if (errcode) {
|
||||
if (errcode === 12) {
|
||||
// 已领取, 给个提示就可以了
|
||||
this.$message.error(errmsg)
|
||||
} else if (errcode !== 14) {
|
||||
// 状态不是等待链上确认的, 都提示错误
|
||||
this.$message.error(errmsg)
|
||||
}
|
||||
} else {
|
||||
if(data?.status == 3) {
|
||||
// alert(`领取成功, 获得积分: ${data.score}`)
|
||||
// this.activityDialog({data, isNewUser: this.isNewUser})
|
||||
localStorage.removeItem(storeageKey)
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
this.$message.error(`claim task reward error: ${err}`)
|
||||
}
|
||||
},
|
||||
|
||||
// 领取助力奖励 || 判断是否是新用户
|
||||
async helpConfirm() {
|
||||
debugger
|
||||
if(this.$route.params.name != undefined) {
|
||||
let newInvite = this.$route.params.name.split("new=")[1];
|
||||
let rtoken = await checkReCaptcha("invite_user");
|
||||
let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/upload_invite_code", {
|
||||
params: { code: newInvite, rtoken: rtoken },
|
||||
headers: { Authorization: `Bearer ${this.token}` }
|
||||
});
|
||||
// let rtoken = await checkReCaptcha("invite_user");
|
||||
// let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/upload_invite_code", {
|
||||
// params: { code: newInvite, rtoken: rtoken },
|
||||
// headers: { Authorization: `Bearer ${this.token}` }
|
||||
// });
|
||||
let res = await apiUploadInviteCode(newInvite)
|
||||
if (res.data.errcode == 0) {
|
||||
this.isNewUser = 0
|
||||
this.getUploadInviteCode(newInvite)
|
||||
// this.getUploadInviteCode(newInvite)
|
||||
} else {
|
||||
this.isNewUser = 1
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user