From 460594f1167d4b8f731789a5da825de9ea4083c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Mon, 28 Aug 2023 18:35:59 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20fix=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=89=AB?= =?UTF-8?q?=E7=A0=81=E7=99=BB=E5=BD=95=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/views/login.vue b/src/views/login.vue index 159a2b1..65faf80 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -89,14 +89,7 @@ import QRCode from 'qrcodejs2-fixes' import { verifyScan, generateQrcode } from '@/api/system/login' var visitorId = '' const fpPromise = import('https://openfpcdn.io/fingerprintjs/v3').then((FingerprintJS) => FingerprintJS.load()) -// Get the visitor identifier when you need it. -fpPromise - .then((fp) => fp.get()) - .then((result) => { - // This is the visitor identifier: - visitorId = result.visitorId - useUserStore().setClientId(visitorId) - }) + const userStore = useUserStore() const router = useRouter() const route = useRoute() @@ -124,7 +117,14 @@ const captchaOnOff = ref('') const register = ref(false) const redirect = ref() redirect.value = route.query.redirect - +// Get the visitor identifier when you need it. +fpPromise + .then((fp) => fp.get()) + .then((result) => { + // This is the visitor identifier: + visitorId = result.visitorId + userStore.setClientId(visitorId) + }) function handleLogin() { proxy.$refs.loginRef.validate((valid) => { if (valid) { @@ -224,7 +224,7 @@ function generateCode() { } }) interval.value = setInterval(() => { - verifyScan({ uuid: uuid, deviceId: visitorId }) + verifyScan({ uuid: uuid, deviceId: userStore.clientId }) .then((res) => { const { code, data } = res if (data.status == -1) {