修改分享链接

This commit is contained in:
yuyongdong 2024-04-16 22:23:14 +08:00
parent b46bede28f
commit 9f010d6bf4
6 changed files with 2152 additions and 21 deletions

View File

@ -34,6 +34,7 @@
<div id="app"></div>
<!-- built files will be auto injected -->
<script src="https://www.google.com/recaptcha/api.js?render=6Ld3xoIpAAAAABW7f5ImgAC6GcWLeDCbt5HPXqe2"></script>
<script src="/src/fingerprint.js"></script>
<script th:inline="javascript">
/**
* 加载外部js

2130
src/utils/fingerprint.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@ const API_BASE = process.env.VUE_APP_API_URL.replace('/api', '');
import CryptoJS from 'crypto-js'
import axios from 'axios'
import store from '@/store'
import fp from '@/utils/fingerprint.js'
const toJson = res => res.json();
@ -66,9 +67,12 @@ export const loginNonce = async (address) => {
}
export const loginWithSignature = async (message, signature, activity) => {
let fps = await fp.load();
let result = await fps.get()
const clientId = result.clientId;
return fetch(`${API_BASE}/api/wallet/login`, {
method: "POST",
body: JSON.stringify({ message, signature, activity }),
body: JSON.stringify({ message, signature, activity,clientId }),
headers: {
"Content-Type": "application/json",
},

View File

@ -538,7 +538,7 @@ export default {
//
copyLink(data) {
this.userData = JSON.parse(localStorage.getItem("userData"))
let url = `${location.protocol}//${location.host}/home/new=${this.userData.code}/box=${data.shareCode}/id=${data.id}`
let url = `${location.protocol}//${location.host}/home/box=${data.shareCode}`
let oInput = document.createElement("input");
oInput.value = url;
document.body.appendChild(oInput);

View File

@ -97,7 +97,6 @@ export default {
boxData: {},
token: null,
helpLogList: [],
boxId: '',
boxCode: '',
boxState: {},
isNewUser: 0,
@ -107,9 +106,9 @@ export default {
},
mounted() {
this.token = getToken()
if(this.$route.params.name) {
if(this.$route.params.code) {
if(this.$route.params.code.split("=")[0] == 'box') {
this.boxCode = this.$route.params.code.split("box=")[1];
this.boxCode = this.$route.params.code.split("=")[1];
this.getBoxData()
if(this.token) {
this.getHelpBoxLog()
@ -121,7 +120,7 @@ export default {
methods: {
//
async getBoxData() {
let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state', {chestId: this.boxId},{})
let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state', {code: this.boxCode},{})
if(res.data.errcode == 0) {
this.boxData = res.data.data
} else if(res.data.errcode == 14) {
@ -131,11 +130,11 @@ export default {
//
async getHelpBoxLog() {
if (this.$route.params.boxId != undefined) {
if (this.$route.params.code != undefined) {
let rtoken = await checkReCaptcha("chest_share");
let res = await this.$axios.post(
process.env.VUE_APP_API_URL+"/api/chest/enhance/list",
{ chestid: this.boxId, rtoken: rtoken },
{ chestid: this.boxCode, rtoken: rtoken },
{
headers: { Authorization: `Bearer ${this.token}` }
}
@ -241,8 +240,8 @@ export default {
},
//
async initBoxState(code,chestId) {
let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state',{code: code, chestId: chestId, },{headers: { Authorization: `Bearer ${this.token}` }})
async initBoxState(boxCode) {
let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/chest/enhance/state',{code: boxCode, },{headers: { Authorization: `Bearer ${this.token}` }})
this.boxState = res.data.data
},

View File

@ -751,11 +751,9 @@ export default {
this.$nextTick(() => {
if (this.$route.params.code) {
if (this.$route.params.code.split("=")[0] == "box") {
if(this.$route.params.code.split("=").split[1]) {
this.helpDialogVisible = true;
}
}
}
});
},
methods: {
@ -776,11 +774,9 @@ export default {
this.inWhiteList = this.userData.inWhiteList
if (this.$route.params.code) {
if(this.$route.params.code.split("=")[0] == 'new') {
if (this.$route.params.code.split("new=")[1] != "undefined") {
this.helpConfirm()
}
}
}
} else {
this.walletDialogVisible = true
@ -796,6 +792,7 @@ export default {
TwitterConnect: "Connect",
TwitterFollow: "Follow",
TwitterRetweet: "Retweet",
TwitterLike: "Like",
DiscordJoin: 'Join',
DiscordConnect: "Connect"
};
@ -841,11 +838,11 @@ export default {
} else if(data.task == "TwitterFollow") {
followTwitter(data.cfg.account)
} else if(data.task == "TwitterLike") {
window.open(`'https://twitter.com/intent/like?tweet_id='+${'1779507826714681538'}`, '_blank');
window.open(`https://twitter.com/intent/like?tweet_id=${data.cfg.content}`, '_blank');
} else if(data.task == "TwitterTweet") {
followTwitter(data.cfg.content)
} else if(data.task == "TwitterRetweet") {
window.open(`'https://twitter.com/intent/retweet?tweet_id='+${'1779507826714681538'}`, '_blank');
window.open(`https://twitter.com/intent/retweet?tweet_id=${data.cfg.content}`, '_blank');
} else if(data.task == "DiscordJoin") {
joinDiscord(data.cfg.account)
} else if (data.task == "DiscordConnect") {
@ -1180,7 +1177,7 @@ export default {
copyLinkCode() {
if(this.token) {
let text = this.userData.code
let url = `${location.protocol}//${location.host}/home/new=${text}/box=undefined/id=undefined`;
let url = `${location.protocol}//${location.host}/home/new=${text}`;
let oInput = document.createElement("input");
oInput.value = url;
document.body.appendChild(oInput);
@ -1197,8 +1194,8 @@ export default {
// ||
async helpConfirm() {
if(this.$route.params.name != undefined) {
let newInvite = this.$route.params.name.split("new=")[1];
if(this.$route.params.code != undefined) {
let newInvite = this.$route.params.code.split("=")[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 },