Skip to content

Commit

Permalink
Feat. 扩充token对象
Browse files Browse the repository at this point in the history
  • Loading branch information
RavelloH committed Oct 29, 2023
1 parent 8853f47 commit 428d0c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,9 @@ const token = {
},
clear: function() {
docCookies.removeItem('usertoken')
},
write: function(string) {
docCookies.setItem('usertoken',string)
}

}
Expand Down
2 changes: 1 addition & 1 deletion platform/signin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ <h2 id="time">00:00</h2>
.then((response) => response.json())
.then((data) => {
if (data.code == 200) {
docCookies.setItem('usertoken', data.inner.token);
token.write(data.inner.token)
switchElementContent('#login-button span', '登录成功,即将跳转')
// 处理本地存储
if (document.querySelector('#check-keep-token-refresh').checked) {
Expand Down

1 comment on commit 428d0c2

@vercel
Copy link

@vercel vercel bot commented on 428d0c2 Oct 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.