消息评论功能 基本完成
This commit is contained in:
@ -105,12 +105,13 @@ public class TokenUtils {
|
||||
|
||||
// 获取用户token
|
||||
public static synchronized String getToken(Context context) {
|
||||
//TODO 时间准确判断
|
||||
SharedPreferences sp = context.getSharedPreferences(Config.PREFERENCE,
|
||||
Context.MODE_PRIVATE);
|
||||
String token = sp.getString("token", null);
|
||||
if (token != null) {
|
||||
long expire = sp.getLong("token_expire", 0) * 1000 - 10 * 1000;
|
||||
long time = System.currentTimeMillis();
|
||||
long time = System.currentTimeMillis();//TODO 用户有可能修改手机时间,导致没能判断Token是否过期
|
||||
// 判断token是否过期
|
||||
if (time < expire) {
|
||||
// token未过期
|
||||
|
||||
Reference in New Issue
Block a user