forked from v4l3n71n/covas-bo
add checktoken interceptors and remove loop refresh
This commit is contained in:
parent
e208c55811
commit
950669bd0e
@ -24,6 +24,7 @@
|
||||
<link rel="mask-icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/safari-pinned-tab.svg" color="#712cf9">
|
||||
<link rel="icon" href="https://getbootstrap.com/docs/5.2/assets/img/favicons/favicon.ico">
|
||||
<meta name="theme-color" content="#712cf9">
|
||||
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
||||
|
||||
|
||||
<style>
|
||||
@ -280,8 +281,9 @@
|
||||
|
||||
<script src="../js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="../js/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script><script src="Dashboard%20Template%20%C2%B7%20Bootstrap%20v5_files/Chart.min.js" integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha" crossorigin="anonymous"></script><script src="Dashboard%20Template%20%C2%B7%20Bootstrap%20v5_files/dashboard.js"></script>
|
||||
<script src="../js/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="js/config.js"></script>
|
||||
<script src="js/library.js"></script>
|
||||
<script src="../js/config.js"></script>
|
||||
<script src="../js/library.js"></script>
|
||||
<script src="../js/home.js"></script>
|
||||
</body></html>
|
6
web/js/home.js
Normal file
6
web/js/home.js
Normal file
@ -0,0 +1,6 @@
|
||||
checkToken();
|
||||
|
||||
const requestInterceptors = axios.interceptors.request.use(function(){
|
||||
checkToken();
|
||||
});
|
||||
|
@ -1,7 +1,12 @@
|
||||
function checkToken(){
|
||||
|
||||
instance.get("token", { withCredentials: true})
|
||||
.then(function(response) { location.href="html/home.html"; })
|
||||
.then(function(response) {
|
||||
if(location.href.pathname == "/")
|
||||
{
|
||||
location.href="/html/home.html";
|
||||
}
|
||||
})
|
||||
.catch(function(error){
|
||||
location.href="/";
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user