diff --git a/index.html b/index.html
index 5d7d72a..208d187 100644
--- a/index.html
+++ b/index.html
@@ -150,12 +150,24 @@
console.log('当前登录的token:' + token);
if (token) {
console.log('走的跳转登录');
- var url = window.location.href; //获取当前页面的url
- if (url.indexOf("?") != -1) { //判断是否存在参数
- url = url.replace(/(\?|#)[^'"]*/, ''); //去除参数
- window.history.pushState({}, 0, url);
- }
- sessionStorage.setItem('gz-token', token);
+ // 校验传过来的token是否合法
+ let url = dataUrl + 'health/isHealth'
+ ajaxRequest(url, "GET", null, false, function () {
+ }, function (result) {
+ console.log(result);
+ if (result.code === 200) {
+ var url = window.location.href; //获取当前页面的url
+ if (url.indexOf("?") != -1) { //判断是否存在参数
+ url = url.replace(/(\?|#)[^'"]*/, ''); //去除参数
+ window.history.pushState({}, 0, url);
+ }
+ sessionStorage.setItem('gz-token', token);
+ } else if (result.code === 401) {
+ closeWindowOpen();
+ }
+ }, function (xhr, status, error) {
+ errorFn(xhr, status, error)
+ }, null);
} else {
// console.log('走的自己登录');
// login();