add
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import querystring from 'querystring'
|
||||
import { Vue, Component } from "nuxt-property-decorator";
|
||||
import { initLIFF } from "~/plugins/liff";
|
||||
|
||||
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 response = await $axios.get(ENDPOINT, {
|
||||
params: { LINEUserID: uid }
|
||||
})
|
||||
await res.setHeader('Content-Type', 'application/json; charset=utf-8')
|
||||
res.end(JSON.stringify(response.data.slice(-1)))
|
||||
}
|
||||
}
|
||||
@@ -8,12 +8,6 @@ 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 }
|
||||
})
|
||||
|
||||
+8
-14
@@ -10,7 +10,7 @@
|
||||
v-text-field(v-model="form.WalletAddress" label="錢包地址" :rules="[requireInput]")
|
||||
p.grey--text 註1: 以太網錢包地址 Ethereum address
|
||||
v-text-field(v-model="form.VerifyRemarks" label="備註")
|
||||
v-btn.airplug(type="submit" dark block depressed large :disabled="!isValid") {{ isValid ? '填好送出完成報到' : '您還沒填好喔' }}
|
||||
v-btn.airplug(type="submit" dark block depressed large :disabled="!isValid") {{ isValid ? '填好送出' : '您還沒填好喔' }}
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Vue, Component } from "nuxt-property-decorator";
|
||||
@@ -50,26 +50,20 @@ export default class Home extends Vue {
|
||||
this.form.LINEstatusMessage = profile.statusMessage;
|
||||
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("---------------------------------------------")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async autofill(uid: string) {
|
||||
const response = await this.$axios.get(`//${window.location.host}/autofill`, { params: { LINEUserID: uid } });
|
||||
const object = response.data[0];
|
||||
if (!object) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const key in this.form) {
|
||||
this.form[key] = object[key];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,14 +270,14 @@ export default class Home extends Vue {
|
||||
|
||||
|
||||
}])
|
||||
await this.liff.sendMessages([{
|
||||
"type": "text",
|
||||
"text": "-----下面就是驗證碼喔-----"
|
||||
}])
|
||||
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()) {
|
||||
|
||||
Reference in New Issue
Block a user