This commit is contained in:
2025-09-18 17:47:27 +08:00
parent de34c36683
commit 7c189840f9

View File

@ -44,6 +44,7 @@
<script setup lang="ts">
import { inject, shallowRef, ref } from 'vue'
import { AuthApi } from '@/api/setting/auth'
import Headers from '../components/headers/index.vue'
import Tree from '../components/tree/index.vue'
import addStandText from '../components/propertyBox/addStandText.vue'
@ -256,8 +257,28 @@ const uploadFile = (event) => {
})
}
}
const getAuthInfo = async () => {
const res = await AuthApi.showAuth()
if (typeof res.data === 'object') {
let time = res.data.expireTime
getStatus(time)
}
}
const getStatus = (time) => {
const timestamp = new Date(time).getTime()
const currentTimestamp = Date.now()
if (timestamp > currentTimestamp) {
window.checkAuthIsValid = true
} else {
window.checkAuthIsValid = false
}
}
onMounted(async () => {
getAuthInfo()
await YJ.on()
createEarth()
})