增加discord相关任务的支持

This commit is contained in:
CounterFire2023 2024-04-12 09:44:09 +08:00
parent d16de8e343
commit 993c716efb
2 changed files with 15 additions and 15 deletions

View File

@ -151,7 +151,7 @@ export const apiUserState = async () => {
// 探索状态
export const apiGameStat = async () => {
const url = `${API_BASE}/api/game/stat`;
return httpPost(url, { })
return httpGet(url)
}
// 开启地图
@ -227,6 +227,6 @@ export const followTwitter = async(name) => {
}
export const joinDiscord = (id) => {
const url = `https://discord.gg${id}`
const url = `https://discord.gg/${id}`
window.open(url, '_blank');
}

View File

@ -500,6 +500,7 @@ import {
followTwitter,
joinDiscord,
apiProgress,
apiGameStat,
} from "./../../utils/webapi.js";
import { sendDailyCheckIn, sendClaimTask, sendHelp } from "./../../utils/chainapi.js";
@ -635,7 +636,8 @@ export default {
TwitterConnect: "Connect",
TwitterFollow: "Follow",
TwitterRetweet: "Retweet",
DiscordJoin: 'Join'
DiscordJoin: 'Join',
DiscordConnect: "Connect"
};
this.activeList.length = 0
for (let data of res.data.data.tasks) {
@ -674,11 +676,13 @@ export default {
if (data.task == "TwitterConnect") {
this.loginTwitter(data);
} else if(data.task == "TwitterFollow") {
followTwitter(data.desc)
followTwitter(data.cfg.account)
} else if(data.task == "TwitterRetweet") {
retweetTwitter(data.desc)
} else if(data.task == "DiscordJoin") {
joinDiscord(data.desc)
joinDiscord(data.cfg.account)
} if (data.task == "DiscordConnect") {
this.loginDiscord()
}
},
//
@ -727,9 +731,6 @@ export default {
alert(newwin.closed, "window closed");
}
}, 10);
},
async joinDiscord() {
},
//
async getTaskClaim(id) {
@ -782,13 +783,12 @@ export default {
//
async getGameStat() {
let res = await this.$axios.get(`/api/game/stat`, {
params: "",
headers: { Authorization: `Bearer ${this.token}` }
});
this.gameStateData = res.data.data;
this.todayStepTicket = res.data.data.ticket;
this.getTotalUsed = res.data.data.totalUsed
let {errcode, data} = await apiGameStat()
if (!errcode) {
this.gameStateData = data;
this.todayStepTicket = data.ticket;
this.getTotalUsed = data.totalUsed
}
},
//