完成兑奖页面逻辑
This commit is contained in:
@@ -82,91 +82,99 @@ onMounted(() => {
|
||||
|
||||
let code = getQueryString('code')
|
||||
console.log('code:', code);
|
||||
if (code) {
|
||||
getUserInfo({ code: code }).then(
|
||||
res => {
|
||||
if (res.code == 0) {
|
||||
console.log('我的信息:', res.data);
|
||||
userStore.updateToken(res.data.authorization)
|
||||
createBGM();
|
||||
// 开始加载组件
|
||||
showLoad.value = true
|
||||
return
|
||||
} else {
|
||||
console.log('hhhh');
|
||||
authorize({ scopeType: 1 }).then(
|
||||
res => {
|
||||
|
||||
if (res.code == 0) {
|
||||
console.log('重定向地址:', res.data);
|
||||
location.replace(res.data)
|
||||
}
|
||||
let dev = import.meta.env.VITE_MODE
|
||||
if (dev != 'dev') {
|
||||
if (code) {
|
||||
getUserInfo({ code: code }).then(
|
||||
res => {
|
||||
if (res.code == 0) {
|
||||
console.log('我的信息:', res.data);
|
||||
userStore.updateToken(res.data.authorization)
|
||||
createBGM();
|
||||
// 开始加载组件
|
||||
showLoad.value = true
|
||||
return
|
||||
} else {
|
||||
console.log('hhhh');
|
||||
authorize({ scopeType: 1 }).then(
|
||||
res => {
|
||||
|
||||
// 活动已结束:6001
|
||||
if (res.code == '6001') {
|
||||
if (res.code == 0) {
|
||||
console.log('重定向地址:', res.data);
|
||||
location.replace(res.data)
|
||||
}
|
||||
|
||||
// 活动已结束:6001
|
||||
if (res.code == '6001') {
|
||||
Toast.fail({
|
||||
message: res.msg,
|
||||
duration: 0,
|
||||
forbidClick: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 活动未开启:6002
|
||||
if (res.code == '6002') {
|
||||
Toast({
|
||||
message: res.msg,
|
||||
duration: 0,
|
||||
icon: 'flag-o',
|
||||
forbidClick: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 其余情况
|
||||
Toast.fail({
|
||||
message: res.msg,
|
||||
duration: 0,
|
||||
forbidClick: true
|
||||
})
|
||||
return
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 活动未开启:6002
|
||||
if (res.code == '6002') {
|
||||
Toast({
|
||||
message: res.msg,
|
||||
duration: 0,
|
||||
icon: 'flag-o',
|
||||
forbidClick: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 其余情况
|
||||
Toast.fail({
|
||||
message:res.msg,
|
||||
duration:0,
|
||||
forbidClick:true
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
authorize({ scopeType: 1 }).then(
|
||||
res => {
|
||||
|
||||
if (res.code == 0) {
|
||||
console.log('重定向地址:', res.data);
|
||||
location.replace(res.data)
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
// 活动已结束:6001
|
||||
if (res.code == '6001') {
|
||||
Toast.fail({
|
||||
message: '活动已结束',
|
||||
duration: 0,
|
||||
forbidClick: true
|
||||
})
|
||||
}
|
||||
|
||||
// 活动未开启:6002
|
||||
if (res.code == '6002') {
|
||||
Toast({
|
||||
message: '活动未开始',
|
||||
duration: 0,
|
||||
icon: 'flag-o',
|
||||
forbidClick: true
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
authorize({ scopeType: 1 }).then(
|
||||
res => {
|
||||
|
||||
if (res.code == 0) {
|
||||
console.log('重定向地址:', res.data);
|
||||
location.replace(res.data)
|
||||
}
|
||||
|
||||
// 活动已结束:6001
|
||||
if (res.code == '6001') {
|
||||
Toast.fail({
|
||||
message: '活动已结束',
|
||||
duration: 0,
|
||||
forbidClick: true
|
||||
})
|
||||
}
|
||||
|
||||
// 活动未开启:6002
|
||||
if (res.code == '6002') {
|
||||
Toast({
|
||||
message: '活动未开始',
|
||||
duration: 0,
|
||||
icon: 'flag-o',
|
||||
forbidClick: true
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
showLoad.value = true
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user