<script setup lang="ts">
|
import { ref } from 'vue';
|
import { useUserStore } from '@vben/stores';
|
import { useAuthStore } from '#/store';
|
import { router } from '#/router';
|
import { preferences } from '@vben/preferences';
|
import { selectTerminal } from '#/mobile/terminal';
|
const user=useUserStore(),auth=useAuthStore(),busy=ref(false);
|
async function switchPc(){busy.value=true;selectTerminal('pc');window.location.assign(router.resolve(preferences.app.defaultHomePath).href);}
|
async function logout(){busy.value=true;try{await auth.logout(false);}finally{busy.value=false;}}
|
</script>
|
<template>
|
<div class="m-panel"><h2 class="m-title">{{user.userInfo?.nickname}}</h2><p class="m-muted">当前使用:移动端</p><p>菜单与操作由账号权限控制。</p></div>
|
<div class="m-panel"><h2 class="m-title">扫码使用说明</h2><p>摄像头扫码需通过 HTTPS 打开并允许相机权限。也可手动输入,或用键盘模拟扫码设备输入并按回车采集。</p><p class="m-muted">扫码查询不会自动执行入库或绑定。</p></div>
|
<div class="m-stack"><button class="m-secondary" :disabled="busy" @click="switchPc">切换至 PC 端</button><button class="m-secondary" :disabled="busy" @click="logout">退出登录</button></div>
|
</template>
|