Merge branch 'login-gtag-RBI' of http://git.kingsome.cn/yuyongdong/UAW into login-gtag-RBI
This commit is contained in:
commit
55d8758ecc
@ -41,7 +41,7 @@
|
||||
gtag('config', 'G-4KSHDJ3MGL');
|
||||
</script>
|
||||
<!-- 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 th:inline="javascript">
|
||||
/**
|
||||
* 加载外部js
|
||||
|
@ -29,7 +29,7 @@ export default {
|
||||
this.itemData.id
|
||||
);
|
||||
datafluxRum.addRumGlobalContext('task_type',{
|
||||
name: itemData.task+'Verify'
|
||||
name: this.itemData.task+'Verify'
|
||||
})
|
||||
if (errcode !== 0) {
|
||||
if (errmsg == "twitter already binded") {
|
||||
|
52
src/utils/debounce.js
Normal file
52
src/utils/debounce.js
Normal file
@ -0,0 +1,52 @@
|
||||
// 防抖
|
||||
export const debounce = (fn, delay) => {
|
||||
var time = null
|
||||
return function() {
|
||||
let context = this;//记录一下this指向
|
||||
let args = arguments;
|
||||
//清除定时任务
|
||||
if (time) clearTimeout(time);
|
||||
time = setTimeout(function() {
|
||||
time = null;
|
||||
fn.apply(context, args)
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
|
||||
export const throttle=(fn, delay) => {
|
||||
// 时间戳
|
||||
var timeTwo = 0 //new Date();
|
||||
// 定时器
|
||||
var timeThree = null;
|
||||
return function() {
|
||||
let context = this;
|
||||
let args = arguments;
|
||||
var now = new Date()
|
||||
|
||||
// !!!!时间戳实现【new Date()虽然获取结果不是时间戳但是计算结果会自动转化为时间戳】
|
||||
// if(now-timeTwo>=delay){
|
||||
// fn.apply(context,args);
|
||||
// timeTwo=new Date();
|
||||
// }
|
||||
|
||||
// !!!!定时器实现
|
||||
// if (!timeThree) {
|
||||
// timeThree = setTimeout(function () {
|
||||
// fn.apply(context, args);
|
||||
// timeThree=null;
|
||||
// }, delay)
|
||||
// }
|
||||
|
||||
// 结合 ps:最后一次触发在固定频率内会在延迟后触发
|
||||
var wait = delay - (now - timeTwo)
|
||||
clearTimeout(timeThree)
|
||||
if (wait <= 0) {
|
||||
fn.apply(context, args);
|
||||
timeTwo = new Date();
|
||||
} else {
|
||||
timeThree = setTimeout(function() {
|
||||
fn.apply(context, args);
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
}
|
@ -91,7 +91,7 @@
|
||||
<div class="box-btm-con-boost">
|
||||
<div class="boost">
|
||||
<p>Invite others to boost your chest for better rewards.</p>
|
||||
<div class="copy-btn" @click="copyLink(boxData)">
|
||||
<div class="copy-btn" @click="antiShake(boxData)">
|
||||
<div class="icon">
|
||||
<img src="@/assets/box/Invite_icon.png" alt="">
|
||||
</div>
|
||||
@ -247,6 +247,7 @@ import { apiBoxOpen } from '@/utils/webapi.js'
|
||||
import PaginationDialog from '@/components/paginationDialog.vue'
|
||||
import Loading from '@/components/loading.vue'
|
||||
import UserImg from "@/components/userImg.vue"
|
||||
import { debounce, throttle } from "@/utils/debounce.js";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -438,7 +439,7 @@ export default {
|
||||
if(res.data.errcode == 0){
|
||||
this.myRecordsList = res.data.data
|
||||
}else{
|
||||
console.info('[getMyHistoricalLog error]',res)
|
||||
// console.info('[getMyHistoricalLog error]',res)
|
||||
}
|
||||
},
|
||||
// 我的助力记录分页
|
||||
@ -472,6 +473,10 @@ export default {
|
||||
address_type: address_type,
|
||||
})
|
||||
},
|
||||
|
||||
antiShake: throttle(function(data) {
|
||||
this.copyLink(data)
|
||||
}, 5000),
|
||||
|
||||
// 关闭弹窗
|
||||
recordsHandleClose() {
|
||||
|
@ -74,7 +74,7 @@
|
||||
<!-- <p></p> -->
|
||||
<p>Invite Your Friends <span @click="ruleDialogVisible = true"><img src="@/assets/home/Icon_.png" alt=""></span></p>
|
||||
</div>
|
||||
<div class="copy-btn" @click="copyLinkCode"><img src="./../../assets/common/Icon_Explore.png" alt="">Copy Invite Link</div>
|
||||
<div class="copy-btn" @click="antiShake"><img src="./../../assets/common/Icon_Explore.png" alt="">Copy Invite Link</div>
|
||||
<div class="copy-see" @click="isLogin">
|
||||
View Invites
|
||||
</div>
|
||||
@ -643,6 +643,7 @@ import Loading from "@/components/loading.vue";
|
||||
import RuleDialog from "./ruleDialog.vue";
|
||||
import NftPartner from './nftPartner.vue'
|
||||
import { getToken } from "@/utils/cookies.js";
|
||||
import { debounce, throttle } from "@/utils/debounce.js";
|
||||
import { datafluxRum } from '@cloudcare/browser-rum'
|
||||
// import { getWalletAddress, isWalletConnected, linkWallet } from "@/wallet/index.js";
|
||||
import {
|
||||
@ -974,7 +975,7 @@ export default {
|
||||
this.$showErr("Please complete the 'Connect Your Discord' quest first");
|
||||
}
|
||||
}else{
|
||||
this.$showErr(`Unknown error[${res.errcode}]`);
|
||||
this.$showErr(`Unknown error[${res.errcode}]`);
|
||||
}
|
||||
}
|
||||
|
||||
@ -990,16 +991,14 @@ export default {
|
||||
},
|
||||
async loginTwitter(id) {
|
||||
// const _address = "0x8c10Ae04BF525734eaC00d5F7c062567461c207F";
|
||||
const clientId = "aG1Jdm1YX0NhSU9rYU5sM0xQeVI6MTpjaQ";
|
||||
// const clientId = "aG1Jdm1YX0NhSU9rYU5sM0xQeVI6MTpjaQ";
|
||||
// const codeChallenge = crypto.randomUUID()
|
||||
const codeChallenge = Date.now();
|
||||
// const codeChallenge = Date.now();
|
||||
const address = this.$store.state.user.address;
|
||||
const redirectUri = "https://oauth-svr.cebggame.com/twitter/redirect_uri";
|
||||
const state = btoa(`${address}|${codeChallenge}|${location.href}`);
|
||||
const url = `https://twitter.com/i/oauth2/authorize?client_id=${clientId}&code_challenge=${codeChallenge}&code_challenge_method=plain&redirect_uri=${encodeURIComponent(
|
||||
redirectUri
|
||||
)}&response_type=code&scope=tweet.read+users.read+follows.read+offline.access+like.read&state=${encodeURIComponent(
|
||||
state
|
||||
// const redirectUri = "https://oauth-svr.cebggame.com/twitter/redirect_uri";
|
||||
// const state = btoa(`${address}|${codeChallenge}|${location.href}`);
|
||||
const url = `https://oauth-svr.cebggame.com/twitter/oauth/${encodeURIComponent(
|
||||
address
|
||||
)}`;
|
||||
let newwin = window.open(url, "twitter connect");
|
||||
var timer = setInterval(function() {
|
||||
@ -1319,6 +1318,9 @@ export default {
|
||||
this.walletDialogVisible = true;
|
||||
}
|
||||
},
|
||||
antiShake: throttle(function() {
|
||||
this.copyLinkCode()
|
||||
}, 5000),
|
||||
|
||||
// 领取助力奖励 || 判断是否是新用户
|
||||
async helpConfirm() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user