Created
August 6, 2020 06:45
-
-
Save pierswu/84dda20ce2f3f42b96844a74e6cb81fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TokenCache { | |
private String token; | |
private LocalDateTime expire; | |
private String getToken(){ | |
if(token==null | |
|| LocalDateTime.now().compareTo(expire)>0){ | |
refreshToken(); | |
} | |
return token; | |
} | |
private void refreshToken(){ | |
//获取token的代码 | |
//更新expire,比官方的过期时间稍早一些 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment