This commit is contained in:
haomingming
2026-11-03 11:32:42 +08:00
parent a12e39b781
commit 4425d79fcf
9 changed files with 135 additions and 20 deletions
@@ -174,7 +174,44 @@ public class UIUtils {
* @return
* boolean
*/
public static boolean isLogined() {
public static boolean isAccountLogined() {
boolean isLogin = SharePrefUtil.getBoolean(getContext(), Constant.IS_LOGIN, false);
String uuid = SharePrefUtil.getString(getContext(), Constant.uuid, "");
return isLogin && !StringUtil.isEmpty(uuid);
}
public static boolean isLogined() {
return isAccountLogined() && SharePrefUtil.getInt(getContext(), "state", 0) == 6;
}
public static boolean checkAccountLoginAndJump(Context context) {
if (isAccountLogined()) {
return true;
}
long now = System.currentTimeMillis();
if (now - lastJumpLoginTime < 800) {
return false;
}
lastJumpLoginTime = now;
Context targetContext = context != null ? context : getContext();
Intent intent;
if (isAccountLogined()) {
intent = new Intent(targetContext, cn.shangyu.gdxzExpert.activity.LoginSetInfoActivity.class);
intent.putExtra("state", SharePrefUtil.getInt(getContext(), "state", 0));
intent.putExtra("checkInfo", SharePrefUtil.getString(getContext(), "checkInfo", ""));
intent.putExtra("phone", SharePrefUtil.getString(getContext(), Constant.mobile, ""));
} else {
intent = new Intent(targetContext, LoginNewActivity.class);
}
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (!(targetContext instanceof Activity)) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
targetContext.startActivity(intent);
return false;
}
private static boolean unusedOldIsLogined() {
// TODO Auto-generated method stub
boolean isLogin = SharePrefUtil.getBoolean(getContext(), Constant.IS_LOGIN, false);
String uuid = SharePrefUtil.getString(getContext(), Constant.uuid, "");
@@ -199,7 +236,15 @@ public class UIUtils {
}
lastJumpLoginTime = now;
Context targetContext = context != null ? context : getContext();
Intent intent = new Intent(targetContext, LoginNewActivity.class);
Intent intent;
if (isAccountLogined()) {
intent = new Intent(targetContext, cn.shangyu.gdxzExpert.activity.LoginSetInfoActivity.class);
intent.putExtra("state", SharePrefUtil.getInt(getContext(), "state", 0));
intent.putExtra("checkInfo", SharePrefUtil.getString(getContext(), "checkInfo", ""));
intent.putExtra("phone", SharePrefUtil.getString(getContext(), Constant.mobile, ""));
} else {
intent = new Intent(targetContext, LoginNewActivity.class);
}
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (!(targetContext instanceof Activity)) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);