|
|
|
@ -1,14 +1,17 @@
|
|
|
|
|
<template> |
|
|
|
|
<el-row v-show="getShow" class="login-form" style="margin-right: -10px; margin-left: -10px"> |
|
|
|
|
<el-col :span="24" style="padding-right: 10px; padding-left: 10px"> |
|
|
|
|
<img src="@/assets/imgs/screen/login-top.png" alt="logo" /> |
|
|
|
|
<img class="topImg" src="@/assets/imgs/screen/login-top.png" alt="logo" /> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="24" style="padding-right: 10px; padding-left: 10px; margin-bottom:20px; text-align: center"> |
|
|
|
|
|
|
|
|
|
<img width="320px" height="320px" :src="imageUrl" alt="Converted Image" v-if="imageUrl" /> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="24" style="padding-right: 10px; padding-left: 10px; text-align: center"> |
|
|
|
|
<img src="@/assets/imgs/screen/login-bottom.png" alt="logo" /> |
|
|
|
|
<el-col v-if="!refreshQR" :span="24" style="padding-right: 10px; padding-left: 10px; text-align: center"> |
|
|
|
|
<img class="bottomImg" src="@/assets/imgs/screen/login-bottom.png" alt="logo" /> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col v-if="refreshQR" :span="24" style="padding-right: 10px; padding-left: 10px; text-align: center"> |
|
|
|
|
<img class="bottomImg" src="@/assets/imgs/screen/qrsx.png" alt="logo" @click="handleRefresh" /> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
</template> |
|
|
|
@ -23,6 +26,7 @@ defineOptions({ name: 'QrCodeForm' })
|
|
|
|
|
|
|
|
|
|
const imageUrl = ref(''); |
|
|
|
|
const uuuid =ref('') |
|
|
|
|
const refreshQR = ref(false) |
|
|
|
|
|
|
|
|
|
const { t } = useI18n() |
|
|
|
|
const { handleBackLogin, getLoginState } = useLoginState() |
|
|
|
@ -30,7 +34,9 @@ const getShow = computed(() => true)
|
|
|
|
|
// 存储定时器 ID,用于后续清除定时器 |
|
|
|
|
let intervalId = ref(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleRefresh = () => { |
|
|
|
|
window.location.reload() |
|
|
|
|
} |
|
|
|
|
const getimg =async ()=>{ |
|
|
|
|
|
|
|
|
|
const array = new Uint32Array(4); |
|
|
|
@ -65,9 +71,10 @@ const getimg =async ()=>{
|
|
|
|
|
// 记录定时器开始的时间 |
|
|
|
|
const startTime = Date.now(); |
|
|
|
|
// 10 分钟的毫秒数 |
|
|
|
|
const tenMinutes = 60 * 1000; |
|
|
|
|
const tenMinutes = 10 *60 * 10000 ; |
|
|
|
|
//定时刷新 判断是否扫码允许 |
|
|
|
|
const refaulst = ()=>{ |
|
|
|
|
refreshQR.value = false; |
|
|
|
|
// 先清除之前的定时器,避免重复调用 |
|
|
|
|
if (intervalId) { |
|
|
|
|
clearInterval(intervalId.value); |
|
|
|
@ -80,6 +87,8 @@ const refaulst = ()=>{
|
|
|
|
|
if (Date.now() - startTime >= tenMinutes) { |
|
|
|
|
clearInterval(intervalId.value); |
|
|
|
|
console.log('定时器已停止,已过去 10 分钟。'); |
|
|
|
|
refreshQR.value = true; |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -101,3 +110,18 @@ onMounted(() => {
|
|
|
|
|
getimg() |
|
|
|
|
}) |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.expired-text{ |
|
|
|
|
color: #ff0000; |
|
|
|
|
margin-top: 40px; |
|
|
|
|
margin-right: 10px; |
|
|
|
|
} |
|
|
|
|
.bottomImg{ |
|
|
|
|
width:320px; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
.topImg{ |
|
|
|
|
height: 200px; |
|
|
|
|
} |
|
|
|
|
</style> |