清空token

This commit is contained in:
尹吉欢
2018-04-08 19:21:44 +08:00
parent 77fd5db476
commit 080be4273c
7 changed files with 17 additions and 2 deletions
+10
View File
@@ -39,6 +39,16 @@
<script src="js/common.js"></script>
<script src="js/push-common.js"></script>
<script type="text/javascript" charset="utf-8">
// 清空过期的Token
var token_add_time = localStorage.getItem("user_token_add_time");
var current_time = new Date().getTime();
var nTime = current_time - token_add_time;
var day = Math.floor(nTime/86400000);
if (day >= 25) {
localStorage.removeItem("user_token");
localStorage.removeItem("user_token_add_time");
}
document.getElementById("quotations").setAttribute("href", BASE_PATH + '/quotations/index');
//document.getElementById("selfInfo").setAttribute("href", BASE_PATH + '/selfInfo/index');
//mui初始化