PDUtils.java
1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.wd.common.utils;
import android.content.Context;
import com.wd.foundation.wdkit.utils.SpUtils;
import com.wd.foundation.wdkitcore.thread.ThreadPoolUtils;
import com.wd.foundation.wdkitcore.tools.StringUtils;
/**
* java类作用描述
*
* @author baozhaoxin
* @version [V1.0.0, 2023/3/4]
* @since V1.0.0
*/
public class PDUtils {
/**
* 全域是否登录
* @return
*/
public static boolean isLogin() {
String userToken = SpUtils.getUserToken();
if(StringUtils.isEmpty(userToken)){
return false;
}else {
return true;
}
}
/**
* 判断当前用户是否是自己(主是否态)
*/
public static boolean judgeIsSelf(String targetUserId) {
if (!PDUtils.isLogin()) {
return false;
}
if (StringUtils.isBlank(targetUserId)) {
return false;
}
return SpUtils.getUserId().equals(targetUserId);
}
/**
* 清除用户信息数据库
*/
public static void clearUserTable(Context mContext){
ThreadPoolUtils.submit(() -> {
//清空用户数据
// RoomUtils.getInstance().clearUserTable(mContext);
// //清空本地浏览历史
// HistoryDataHelper.getInstance().delAllHistory();
});
}
}