simple inviter code

This commit is contained in:
yuexin 2024-04-13 23:17:23 +08:00
parent 78ba497647
commit b673d2f90b
2 changed files with 15 additions and 37 deletions

View File

@ -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 {

View File

@ -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
}