Merge pull request #13400 from dataease/pr@dev-v2@perf_share_exp_request

perf(仪表板): 公共链接过期后禁止加载资源请求
This commit is contained in:
xuwei-fit2cloud 2024-11-19 11:08:08 +08:00 committed by GitHub
commit e0ef4e4027
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 0 deletions

View File

@ -80,7 +80,15 @@ onMounted(async () => {
}
linkExist.value = true
linkExp.value = !!proxyInfo.exp
if (!!proxyInfo.exp) {
loading.value = false
return
}
pwdValid.value = !!proxyInfo.pwdValid
if (!pwdValid.value) {
loading.value = false
return
}
state.ticketValidVO = proxyInfo.ticketValidVO
nextTick(() => {
const method = pcanvas?.value?.loadCanvasDataAsync

View File

@ -1,5 +1,11 @@
<template>
<div class="mobile-link-container" v-loading="loading">
<ErrorTemplate
v-if="!loading && (disableError || peRequireError)"
:msg="
disableError ? '已禁用分享功能,请联系管理员!' : '已设置有效期密码必填,当前链接无效!'
"
/>
<LinkError v-if="!loading && !linkExist" />
<Exp v-else-if="!loading && linkExp" />
<PwdTips v-else-if="!loading && !pwdValid" />
@ -24,6 +30,9 @@ import { ProxyInfo, shareProxy } from './ShareProxy'
import Exp from './exp.vue'
import LinkError from './error.vue'
import PwdTips from './pwd.vue'
import ErrorTemplate from './ErrorTemplate.vue'
const disableError = ref(true)
const peRequireError = ref(true)
const linkExist = ref(false)
const loading = ref(true)
const linkExp = ref(false)
@ -43,13 +52,33 @@ onMounted(async () => {
curType.value = proxyInfo.type || 'dashboard'
dvMainStore.setInMobile(true)
dvMainStore.setMobileInPc(curType.value === 'dashboard')
if (proxyInfo?.shareDisable) {
loading.value = false
disableError.value = true
return
}
disableError.value = false
if (proxyInfo && !proxyInfo.peRequireValid) {
loading.value = false
peRequireError.value = true
return
}
peRequireError.value = false
if (!proxyInfo?.resourceId) {
loading.value = false
return
}
linkExist.value = true
linkExp.value = !!proxyInfo.exp
if (!!proxyInfo.exp) {
loading.value = false
return
}
pwdValid.value = !!proxyInfo.pwdValid
if (!proxyInfo.pwdValid) {
loading.value = false
return
}
state.ticketValidVO = proxyInfo.ticketValidVO
nextTick(() => {
const method = pcanvas?.value?.loadCanvasDataAsync