first commit
This commit is contained in:
19
src/components/CheckToken/index.vue
Normal file
19
src/components/CheckToken/index.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
<script setup lang="ts" name="check-token">
|
||||
import { checkToken } from '/@/api/login';
|
||||
|
||||
const refreshLock = ref(false);
|
||||
const refreshTime = ref();
|
||||
|
||||
onMounted(() => {
|
||||
refreshToken();
|
||||
});
|
||||
|
||||
const refreshToken = () => {
|
||||
refreshTime.value = setInterval(() => {
|
||||
checkToken(refreshTime.value, refreshLock.value);
|
||||
}, 60000);
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user