feat(签署文书): 统一签署态文书样式并精简演示种子为单份麻精同意书
This commit is contained in:
@@ -10,7 +10,6 @@ import { useLoginStore } from '@/stores/login'
|
||||
const loginStore = useLoginStore()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
let authorizationTimer: ReturnType<typeof setInterval> | undefined
|
||||
let authorizationRefreshing = false
|
||||
|
||||
async function redirectIfUnauthorized() {
|
||||
@@ -44,16 +43,24 @@ function handleWindowFocus() {
|
||||
void refreshAuthorization()
|
||||
}
|
||||
|
||||
/**
|
||||
* 切标签页回来时浏览器不一定派发 window focus(窗口本身没失焦),
|
||||
* 所以补一条 visibilitychange,保证「离开页面期间别人改了权限」能立刻收敛。
|
||||
*/
|
||||
function handleVisibilityChange() {
|
||||
if (document.visibilityState === 'visible') {
|
||||
void refreshAuthorization()
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
authorizationTimer = setInterval(() => void refreshAuthorization(), 15_000)
|
||||
window.addEventListener('focus', handleWindowFocus)
|
||||
document.addEventListener('visibilitychange', handleVisibilityChange)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (authorizationTimer) {
|
||||
clearInterval(authorizationTimer)
|
||||
}
|
||||
window.removeEventListener('focus', handleWindowFocus)
|
||||
document.removeEventListener('visibilitychange', handleVisibilityChange)
|
||||
})
|
||||
|
||||
watch(
|
||||
|
||||
Reference in New Issue
Block a user