This commit is contained in:
2022-07-21 03:28:35 +00:00
parent d7c883d6df
commit 51b34b0e1d
30103 changed files with 4152204 additions and 23 deletions
+9 -2
View File
@@ -1,16 +1,23 @@
import querystring from 'querystring'
import { Vue, Component } from "nuxt-property-decorator";
import { initLIFF } from "~/plugins/liff";
const ENDPOINT = 'https://json_2series.digitalent.tw/users'
const ENDPOINT = 'https://api.contree.io/profile'
export default {
async middleware({ req, res, error, $axios, redirect }) {
const url: URL = new URL(req.url, `https://${req.headers.host}`)
const uid: string = url.searchParams.get('LINEUserID') || ''
//const veify_checked = url.searchParams.get('Veify_Checked')
//console.log(veify_checked)
console.log(uid)
const response = await $axios.get(ENDPOINT, {
params: { LINEUserID: uid }
})
res.setHeader('Content-Type', 'application/json; charset=utf-8')
await res.setHeader('Content-Type', 'application/json; charset=utf-8')
res.end(JSON.stringify(response.data.slice(-1)))
}
}
+239 -6
View File
@@ -28,13 +28,17 @@ export default class Home extends Vue {
LINEUserID: "",
LINEdisplayName: "",
LINEpictureUrl: "",
LINEstatusMessage: ""
};
LINEstatusMessage: "",
VerifyNUM: "",
VerifySys: "",
Veify_Checked: ""
};
liff: any;
async mounted() {
const liffId = "1657251293-4DpLENpm";
const liffId = "1657251293-7LagMEa1";
const liff = (this.liff = await initLIFF(liffId));
if (!liff.isLoggedIn()) {
liff.login();
@@ -44,8 +48,17 @@ export default class Home extends Vue {
this.form.LINEdisplayName = profile.displayName;
this.form.LINEpictureUrl = profile.pictureUrl;
this.form.LINEstatusMessage = profile.statusMessage;
this.autofill(profile.userId);
await this.autofill(profile.userId);
console.log(this.form);
console.log("---------------------------------------------");
console.log(this.form.Veify_Checked)
console.log("---------------------------------------------");
if(this.form.Veify_Checked == "OK")
{
console.log("---------------------------------------------");
alert('您已經綁定過囉,如重新綁定需24小時解綁時間');
console.log("---------------------------------------------")
}
}
}
@@ -55,15 +68,229 @@ export default class Home extends Vue {
if (!object) {
return;
}
for(const key in this.form) {
for (const key in this.form) {
this.form[key] = object[key];
}
}
async submit() {
this.form.VerifyNUM = "Contree-" + Math.floor(Math.random()*999) + "-" + Math.floor(Math.random()*999);
try {
await this.$axios.$post(`//${window.location.host}/submit`, this.form);
this.liff.closeWindow();
if (this.liff.isInClient()) {
await this.liff.sendMessages([{
"type": "flex",
"altText": "this is a carousel template",
"contents": {
"type": "carousel",
"contents": [
{
"type": "bubble",
"direction": "ltr",
"hero": {
"type": "image",
"url": "https:/web.gsct.tw/Contree/verify/walletadd.png",
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "cover"
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "Step.1",
"weight": "bold",
"align": "center",
"contents": []
},
{
"type": "text",
"text": "輸入錢包位置",
"weight": "bold",
"align": "center",
"contents": []
}
]
}
},
{
"type": "bubble",
"direction": "ltr",
"hero": {
"type": "image",
"url": "https:/web.gsct.tw/Contree/verify/biono.png",
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "cover"
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "Step.1",
"weight": "bold",
"align": "center",
"contents": []
},
{
"type": "text",
"text": "獲得Bio驗證碼",
"weight": "bold",
"align": "center",
"contents": []
}
]
}
},
{
"type": "bubble",
"direction": "ltr",
"hero": {
"type": "image",
"url": "https:/web.gsct.tw/Contree/verify/opensea.png",
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "cover"
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "Step.3",
"weight": "bold",
"align": "center",
"contents": []
},
{
"type": "text",
"text": "進入錢包位置",
"weight": "bold",
"align": "center",
"contents": []
}
]
}
},
{
"type": "bubble",
"direction": "ltr",
"hero": {
"type": "image",
"url": "https:/web.gsct.tw/Contree/verify/contect.png",
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "cover"
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "Step.4",
"weight": "bold",
"align": "center",
"contents": []
},
{
"type": "text",
"text": "完成opensea簽署",
"weight": "bold",
"align": "center",
"contents": []
}
]
}
},
{
"type": "bubble",
"direction": "ltr",
"hero": {
"type": "image",
"url": "https:/web.gsct.tw/Contree/verify/bio.png",
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "cover"
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "Step.5",
"weight": "bold",
"align": "center",
"contents": []
},
{
"type": "text",
"text": "在Account的Bio 填入驗證碼 ",
"weight": "bold",
"align": "center",
"contents": []
}
]
}
},
{
"type": "bubble",
"direction": "ltr",
"hero": {
"type": "image",
"url": "https:/web.gsct.tw/Contree/verify/fin.png",
"size": "full",
"aspectRatio": "1:1",
"aspectMode": "cover"
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "Step.6",
"weight": "bold",
"align": "center",
"contents": []
},
{
"type": "text",
"text": "綁定完成",
"weight": "bold",
"align": "center",
"contents": []
}
]
}
}
]
}
}])
await this.liff.sendMessages([{
"type": "text",
"text": this.form.VerifyNUM
}])
await this.liff.sendMessages([{
"type": "text",
"text": "下面就是驗證碼喔"
}])
this.liff.closeWindow();
} else {
if (this.liff.isLoggedIn()) {
alert('您使用的是外部瀏覽器');
window.location.assign("https://api.contree.io/posts/1");
}
}
} catch (error) {
alert("送出失敗");
}
@@ -83,6 +310,11 @@ export default class Home extends Vue {
? true
: "電話號碼不正確, 市話記得加區碼喔";
}
isWeb3Address(value) {
return value.replace(/[^a-z0-9]/g, "").length >= 9
? true
: "只能打英文數字喔";
}
}
</script>
<style scoped>
@@ -90,6 +322,7 @@ button.airplug.theme--dark.v-btn:not(.v-btn--flat):not(.v-btn--text):not(.v-btn-
background-color: #44d62c !important;
color: white !important;
}
button.airplug.theme--dark.v-btn.v-btn--disabled:not(.v-btn--flat):not(.v-btn--text):not(.v-btn--outlined) {
opacity: 0.3;
}
+3 -1
View File
@@ -20,6 +20,8 @@ export default {
let response = await $axios.get(ENDPOINT, {
params: { LINEUserID: uid }
})
const vnum = data.VerifyNUM
const vsys = data.VerifySys
//data.BeaconMode = 'leave'
//data.FLAG = false
@@ -30,7 +32,7 @@ export default {
await $axios.post(ENDPOINT, data)
}
await $axios.get(ENDPOINT2, {
params: { userid: uid }
params: { userid: uid ,Verify: vnum,VerifySys: vsys }
})
}
}