消息评论功能 基本完成

This commit is contained in:
khy
2016-11-11 18:17:09 +08:00
parent f243d98094
commit 8cb2ecd113
31 changed files with 1684 additions and 139 deletions

View File

@ -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未过期