Browse Source

三方登录界面修改

chenjun 1 year ago
parent
commit
f6b39441ab
1 changed files with 3 additions and 0 deletions
  1. 3 0
      zjugis-workflow/src/main/resources/static/login.html

+ 3 - 0
zjugis-workflow/src/main/resources/static/login.html

@@ -50,6 +50,9 @@
                     // 设置到 localStorage 中
                     localStorage.setItem('ACCESS_TOKEN', JSON.stringify(a));
                     localStorage.setItem('REFRESH_TOKEN', JSON.stringify(r));
+                    // 设置带有过期时间的cookie
+                    var expiryDate = new Date();
+                    expiryDate.setDate(expiryDate.getDate() + 1); // 1天后过期
                     document.cookie = 'ACCESS_TOKEN=' + result.data.access_token + '; expires=' + expiryDate.toUTCString();
                     document.cookie = 'REFRESH_TOKEN=' + result.data.refresh_token + '; expires=' + expiryDate.toUTCString();
                     // 提示登录成功