mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 16:24:25 +08:00
add switch to mobile/desktop device in login/unlock page
This commit is contained in:
@@ -89,6 +89,14 @@
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" class="py-0 mt-1 mb-4">
|
||||
<div class="d-flex align-center justify-space-between flex-wrap">
|
||||
<a href="javascript:void(0);" @click="showMobileQrCode = true">
|
||||
<span class="nav-item-title">{{ $t('Use on Mobile Device') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12">
|
||||
<v-btn block :disabled="inputIsEmpty || logining || verifying"
|
||||
@click="login" v-if="!show2faInput">
|
||||
@@ -143,6 +151,7 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<switch-to-mobile-dialog v-model:show="showMobileQrCode" />
|
||||
<snack-bar ref="snackbar" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -177,6 +186,7 @@ export default {
|
||||
verifying: false,
|
||||
show2faInput: false,
|
||||
twoFAVerifyType: 'passcode',
|
||||
showMobileQrCode: false,
|
||||
icons: {
|
||||
eye: mdiEyeOutline,
|
||||
eyeSlash: mdiEyeOffOutline,
|
||||
|
||||
@@ -161,26 +161,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layout-overlay" :class="{ 'visible': showVerticalOverlayMenu }" @click="showVerticalOverlayMenu = false"></div>
|
||||
<switch-to-mobile-dialog v-model:show="showMobileQrCode" />
|
||||
|
||||
<v-dialog width="400" v-model="showMobileQrCode">
|
||||
<v-card>
|
||||
<v-toolbar color="primary">
|
||||
<v-toolbar-title>{{ $t('global.app.title') }}</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pa-4">
|
||||
<p>{{ $t('You can scan the below QR code on your mobile device.') }}</p>
|
||||
</v-card-text>
|
||||
<v-card-text class="pa-4 w-100 d-flex justify-center">
|
||||
<img alt="qrcode" class="img-url-qrcode" :src="mobileUrlQrCodePath" />
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn :href="mobileVersionPath">{{$t('Switch to Mobile Version') }}</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="showMobileQrCode = false">{{ $t('Close') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<div class="layout-overlay" :class="{ 'visible': showVerticalOverlayMenu }" @click="showVerticalOverlayMenu = false"></div>
|
||||
|
||||
<v-overlay class="justify-center align-center" :persistent="true" v-model="showLoading">
|
||||
<v-progress-circular indeterminate></v-progress-circular>
|
||||
@@ -200,8 +183,6 @@ import { useSettingsStore } from '@/stores/setting.js';
|
||||
import { useUserStore } from '@/stores/user.js';
|
||||
|
||||
import { getSystemTheme } from '@/lib/ui.js';
|
||||
import { getMobileUrlQrCodePath } from '@/lib/qrcode.js';
|
||||
import { getMobileVersionPath } from '@/lib/version.js';
|
||||
|
||||
import {
|
||||
mdiMenu,
|
||||
@@ -258,12 +239,6 @@ export default {
|
||||
const { mdAndDown } = useDisplay();
|
||||
return mdAndDown.value;
|
||||
},
|
||||
mobileUrlQrCodePath() {
|
||||
return getMobileUrlQrCodePath();
|
||||
},
|
||||
mobileVersionPath() {
|
||||
return getMobileVersionPath();
|
||||
},
|
||||
currentNickName() {
|
||||
return this.userStore.currentUserNickname || this.$t('User');
|
||||
},
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
v-model="pinCode" @pincode:confirm="unlockByPin" />
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" class="py-0 mt-4 mb-4">
|
||||
<div class="d-flex align-center justify-space-between flex-wrap">
|
||||
<a href="javascript:void(0);" @click="showMobileQrCode = true">
|
||||
<span class="nav-item-title">{{ $t('Use on Mobile Device') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12">
|
||||
<v-btn block :disabled="!isPinCodeValid(pinCode) || verifyingByWebAuthn"
|
||||
@click="unlockByPin(pinCode)">
|
||||
@@ -91,6 +99,7 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<switch-to-mobile-dialog v-model:show="showMobileQrCode" />
|
||||
<confirm-dialog ref="confirmDialog"/>
|
||||
<snack-bar ref="snackbar" />
|
||||
</div>
|
||||
@@ -113,7 +122,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
pinCode: '',
|
||||
verifyingByWebAuthn: false
|
||||
verifyingByWebAuthn: false,
|
||||
showMobileQrCode: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
Reference in New Issue
Block a user