修改分享链接
This commit is contained in:
parent
b46bede28f
commit
9f010d6bf4
@ -34,6 +34,7 @@
|
|||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<!-- built files will be auto injected -->
|
<!-- built files will be auto injected -->
|
||||||
<script src="https://www.google.com/recaptcha/api.js?render=6Ld3xoIpAAAAABW7f5ImgAC6GcWLeDCbt5HPXqe2"></script>
|
<script src="https://www.google.com/recaptcha/api.js?render=6Ld3xoIpAAAAABW7f5ImgAC6GcWLeDCbt5HPXqe2"></script>
|
||||||
|
<script src="/src/fingerprint.js"></script>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
/**
|
/**
|
||||||
* 加载外部js
|
* 加载外部js
|
||||||
|
2130
src/utils/fingerprint.js
Normal file
2130
src/utils/fingerprint.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,7 @@ const API_BASE = process.env.VUE_APP_API_URL.replace('/api', '');
|
|||||||
import CryptoJS from 'crypto-js'
|
import CryptoJS from 'crypto-js'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
|
import fp from '@/utils/fingerprint.js'
|
||||||
|
|
||||||
const toJson = res => res.json();
|
const toJson = res => res.json();
|
||||||
|
|
||||||
@ -66,9 +67,12 @@ export const loginNonce = async (address) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const loginWithSignature = async (message, signature, activity) => {
|
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`, {
|
return fetch(`${API_BASE}/api/wallet/login`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({ message, signature, activity }),
|
body: JSON.stringify({ message, signature, activity,clientId }),
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
|
@ -538,7 +538,7 @@ export default {
|
|||||||
// 复制助力链接
|
// 复制助力链接
|
||||||
copyLink(data) {
|
copyLink(data) {
|
||||||
this.userData = JSON.parse(localStorage.getItem("userData"))
|
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");
|
let oInput = document.createElement("input");
|
||||||
oInput.value = url;
|
oInput.value = url;
|
||||||
document.body.appendChild(oInput);
|
document.body.appendChild(oInput);
|
||||||
|
@ -97,7 +97,6 @@ export default {
|
|||||||
boxData: {},
|
boxData: {},
|
||||||
token: null,
|
token: null,
|
||||||
helpLogList: [],
|
helpLogList: [],
|
||||||
boxId: '',
|
|
||||||
boxCode: '',
|
boxCode: '',
|
||||||
boxState: {},
|
boxState: {},
|
||||||
isNewUser: 0,
|
isNewUser: 0,
|
||||||
@ -107,9 +106,9 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.token = getToken()
|
this.token = getToken()
|
||||||
if(this.$route.params.name) {
|
if(this.$route.params.code) {
|
||||||
if(this.$route.params.code.split("=")[0] == 'box') {
|
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()
|
this.getBoxData()
|
||||||
if(this.token) {
|
if(this.token) {
|
||||||
this.getHelpBoxLog()
|
this.getHelpBoxLog()
|
||||||
@ -121,7 +120,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 宝箱信息接口
|
// 宝箱信息接口
|
||||||
async getBoxData() {
|
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) {
|
if(res.data.errcode == 0) {
|
||||||
this.boxData = res.data.data
|
this.boxData = res.data.data
|
||||||
} else if(res.data.errcode == 14) {
|
} else if(res.data.errcode == 14) {
|
||||||
@ -131,11 +130,11 @@ export default {
|
|||||||
|
|
||||||
// 获取帮助的宝箱助力记录
|
// 获取帮助的宝箱助力记录
|
||||||
async getHelpBoxLog() {
|
async getHelpBoxLog() {
|
||||||
if (this.$route.params.boxId != undefined) {
|
if (this.$route.params.code != undefined) {
|
||||||
let rtoken = await checkReCaptcha("chest_share");
|
let rtoken = await checkReCaptcha("chest_share");
|
||||||
let res = await this.$axios.post(
|
let res = await this.$axios.post(
|
||||||
process.env.VUE_APP_API_URL+"/api/chest/enhance/list",
|
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}` }
|
headers: { Authorization: `Bearer ${this.token}` }
|
||||||
}
|
}
|
||||||
@ -241,8 +240,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 助力状态查询
|
// 助力状态查询
|
||||||
async initBoxState(code,chestId) {
|
async initBoxState(boxCode) {
|
||||||
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}` }})
|
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
|
this.boxState = res.data.data
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -751,9 +751,7 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$route.params.code) {
|
if (this.$route.params.code) {
|
||||||
if (this.$route.params.code.split("=")[0] == "box") {
|
if (this.$route.params.code.split("=")[0] == "box") {
|
||||||
if(this.$route.params.code.split("=").split[1]) {
|
this.helpDialogVisible = true;
|
||||||
this.helpDialogVisible = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -776,9 +774,7 @@ export default {
|
|||||||
this.inWhiteList = this.userData.inWhiteList
|
this.inWhiteList = this.userData.inWhiteList
|
||||||
if (this.$route.params.code) {
|
if (this.$route.params.code) {
|
||||||
if(this.$route.params.code.split("=")[0] == 'new') {
|
if(this.$route.params.code.split("=")[0] == 'new') {
|
||||||
if (this.$route.params.code.split("new=")[1] != "undefined") {
|
this.helpConfirm()
|
||||||
this.helpConfirm()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -796,6 +792,7 @@ export default {
|
|||||||
TwitterConnect: "Connect",
|
TwitterConnect: "Connect",
|
||||||
TwitterFollow: "Follow",
|
TwitterFollow: "Follow",
|
||||||
TwitterRetweet: "Retweet",
|
TwitterRetweet: "Retweet",
|
||||||
|
TwitterLike: "Like",
|
||||||
DiscordJoin: 'Join',
|
DiscordJoin: 'Join',
|
||||||
DiscordConnect: "Connect"
|
DiscordConnect: "Connect"
|
||||||
};
|
};
|
||||||
@ -841,11 +838,11 @@ export default {
|
|||||||
} else if(data.task == "TwitterFollow") {
|
} else if(data.task == "TwitterFollow") {
|
||||||
followTwitter(data.cfg.account)
|
followTwitter(data.cfg.account)
|
||||||
} else if(data.task == "TwitterLike") {
|
} 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") {
|
} else if(data.task == "TwitterTweet") {
|
||||||
followTwitter(data.cfg.content)
|
followTwitter(data.cfg.content)
|
||||||
} else if(data.task == "TwitterRetweet") {
|
} 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") {
|
} else if(data.task == "DiscordJoin") {
|
||||||
joinDiscord(data.cfg.account)
|
joinDiscord(data.cfg.account)
|
||||||
} else if (data.task == "DiscordConnect") {
|
} else if (data.task == "DiscordConnect") {
|
||||||
@ -1180,7 +1177,7 @@ export default {
|
|||||||
copyLinkCode() {
|
copyLinkCode() {
|
||||||
if(this.token) {
|
if(this.token) {
|
||||||
let text = this.userData.code
|
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");
|
let oInput = document.createElement("input");
|
||||||
oInput.value = url;
|
oInput.value = url;
|
||||||
document.body.appendChild(oInput);
|
document.body.appendChild(oInput);
|
||||||
@ -1197,8 +1194,8 @@ export default {
|
|||||||
|
|
||||||
// 领取助力奖励 || 判断是否是新用户
|
// 领取助力奖励 || 判断是否是新用户
|
||||||
async helpConfirm() {
|
async helpConfirm() {
|
||||||
if(this.$route.params.name != undefined) {
|
if(this.$route.params.code != undefined) {
|
||||||
let newInvite = this.$route.params.name.split("new=")[1];
|
let newInvite = this.$route.params.code.split("=")[1];
|
||||||
// let rtoken = await checkReCaptcha("invite_user");
|
// let rtoken = await checkReCaptcha("invite_user");
|
||||||
// let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/upload_invite_code", {
|
// let res = await this.$axios.get(process.env.VUE_APP_API_URL+"/api/activity/upload_invite_code", {
|
||||||
// params: { code: newInvite, rtoken: rtoken },
|
// params: { code: newInvite, rtoken: rtoken },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user