Commit ca9f4d26 by sikang

修改默认登录方式

parent dbbce67b
...@@ -36,7 +36,6 @@ import zendesk.support.Support; ...@@ -36,7 +36,6 @@ import zendesk.support.Support;
* 配置 BaseLibrary * 配置 BaseLibrary
*/ */
public class LibConfig { public class LibConfig {
private static boolean useDefaulLoginMode = true;//请求出现登录时是否使用默认的响应方式(跳转登录界面)
/** /**
* BuildConfig 数据 * BuildConfig 数据
*/ */
...@@ -219,15 +218,4 @@ public class LibConfig { ...@@ -219,15 +218,4 @@ public class LibConfig {
}); });
} }
/**
* 清除默认的登录失效响应
*/
public static void clearDefaultLoginMode() {
useDefaulLoginMode = false;
}
public static boolean isDefaultLoginMode() {
return useDefaulLoginMode;
}
} }
...@@ -62,7 +62,7 @@ public class LoginManager { ...@@ -62,7 +62,7 @@ public class LoginManager {
//广播通知 //广播通知
EventBus.getDefault().post(ActionEnum.LOGIN_INVALID); EventBus.getDefault().post(ActionEnum.LOGIN_INVALID);
if (LibConfig.isDefaultLoginMode()) { if (!TextUtils.isEmpty(LibConfig.LOGIN_ACTIVITY_ACTION)) {
//跳转登录界面 //跳转登录界面
if (isActionSupport(LibConfig.getContext(), LibConfig.LOGIN_ACTIVITY_ACTION)) { if (isActionSupport(LibConfig.getContext(), LibConfig.LOGIN_ACTIVITY_ACTION)) {
new ActivityJumper.Builder(LibConfig.getContext(), LibConfig.LOGIN_ACTIVITY_ACTION) new ActivityJumper.Builder(LibConfig.getContext(), LibConfig.LOGIN_ACTIVITY_ACTION)
......
...@@ -60,7 +60,7 @@ public class AppInfoUtils { ...@@ -60,7 +60,7 @@ public class AppInfoUtils {
@SuppressLint("MissingPermission") @SuppressLint("MissingPermission")
public static String getPhoneNumber(Context context) { public static String getPhoneNumber(Context context) {
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String[] permissions = new String[]{Manifest.permission.READ_SMS, Manifest.permission.READ_PHONE_NUMBERS, Manifest.permission.READ_PHONE_STATE}; String[] permissions = new String[]{Manifest.permission.READ_SMS,Manifest.permission.READ_PHONE_STATE};
if (telephonyManager != null && PermissionsHelper.isGranted(context, permissions)) { if (telephonyManager != null && PermissionsHelper.isGranted(context, permissions)) {
return telephonyManager.getLine1Number(); return telephonyManager.getLine1Number();
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment