1、修改登录功能并验证,除了支付宝登录其他都已验证
2、完成个人中心的功能,个人主页完成、钱包完成、背包完成
This commit is contained in:
@@ -4,6 +4,7 @@ package com.qxcm.qxlive;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
@@ -19,21 +20,24 @@ import com.mobile.auth.gatewayauth.PreLoginResultListener;
|
||||
import com.mobile.auth.gatewayauth.ResultCode;
|
||||
import com.mobile.auth.gatewayauth.TokenResultListener;
|
||||
import com.mobile.auth.gatewayauth.model.TokenRet;
|
||||
import com.qxcm.modulelogin.activity.ImproveInfoActivity;
|
||||
import com.qxcm.modulelogin.activity.LoginActivity;
|
||||
import com.qxcm.modulelogin.activity.PasswordLoginActivity;
|
||||
import com.qxcm.modulemain.activity.MainActivity;
|
||||
import com.qxcm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.qxcm.moduleutil.base.CommonAppContext;
|
||||
import com.qxcm.moduleutil.bean.UserBean;
|
||||
import com.qxcm.moduleutil.dialog.PolicyDialog;
|
||||
import com.qxcm.moduleutil.utils.SpUtil;
|
||||
import com.qxcm.moduleutil.utils.logger.Logger;
|
||||
import com.qxcm.qxlive.databinding.ActivityLaunchPageBinding;
|
||||
|
||||
public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, ActivityLaunchPageBinding> implements LaunchContacter.View{
|
||||
public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, ActivityLaunchPageBinding> implements LaunchContacter.View {
|
||||
private Handler handler;
|
||||
public PhoneNumberAuthHelper phoneNumberAuthHelper;
|
||||
private TokenResultListener tokenResultListener;
|
||||
private boolean canOnePass;
|
||||
private boolean isCanOnePass=false;
|
||||
private boolean isCanOnePass = true;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
@@ -51,8 +55,8 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
|
||||
// BaseApplication.getInstance().checkInEmulator();
|
||||
// BaseApplication.getInstance().initHeartBeat();
|
||||
// //延迟1.5秒执行
|
||||
// handler.postDelayed(runnable, 100);
|
||||
initLogin();
|
||||
handler.postDelayed(runnable, 100);
|
||||
// initLogin();
|
||||
} else {
|
||||
PolicyDialog policyDialog = new PolicyDialog(this);
|
||||
policyDialog.setCancelable(false);
|
||||
@@ -82,12 +86,8 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
|
||||
|
||||
private void initLogin() {
|
||||
|
||||
if (isCanOnePass){
|
||||
initQuickLogin();
|
||||
checkOnePass();
|
||||
}else {
|
||||
startActivity(new Intent(this, MainActivity.class));
|
||||
}
|
||||
initQuickLogin();
|
||||
checkOnePass();
|
||||
}
|
||||
|
||||
private void checkOnePass() {
|
||||
@@ -116,6 +116,7 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
|
||||
isRoot();
|
||||
}
|
||||
}
|
||||
|
||||
private void isRoot() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
@@ -156,18 +157,20 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
|
||||
}
|
||||
} else {
|
||||
Logger.e("SplashEnd", "ARouters.MAIN");
|
||||
// UserBean userBean = MyApplication.getInstance().getUser();
|
||||
// if (userBean.getSex() == 0) {
|
||||
// Intent intent = new Intent(this, ImproveInfoActivity.class);
|
||||
// intent.putExtra("nickname", String.format("用户%s", userBean.getUser_code()));
|
||||
// intent.putExtra("user_no_parent", userBean.getUser_no_parent());
|
||||
// startActivity(intent);
|
||||
// } else {
|
||||
// startActivity(new Intent(this, MainActivity.class));
|
||||
// }
|
||||
UserBean userBean = CommonAppContext.getInstance().getUser();
|
||||
if (userBean.getSex() == 0) {
|
||||
Intent intent = new Intent(this, ImproveInfoActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("userBean", userBean);
|
||||
intent.putExtras(bundle);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
startActivity(new Intent(this, MainActivity.class));
|
||||
}
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
private void doOnePass() {
|
||||
AuthUIConfig authUIConfig = new AuthUIConfig.Builder()
|
||||
//导航栏
|
||||
@@ -237,6 +240,7 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
|
||||
phoneNumberAuthHelper.setAuthUIConfig(authUIConfig);
|
||||
phoneNumberAuthHelper.getLoginToken(getApplicationContext(), 5000);
|
||||
}
|
||||
|
||||
private void initQuickLogin() {
|
||||
tokenResultListener = new TokenResultListener() {
|
||||
@Override
|
||||
@@ -252,7 +256,8 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
|
||||
phoneNumberAuthHelper.hideLoginLoading();
|
||||
//获取成功 dimiss就去登录、登录成功
|
||||
phoneNumberAuthHelper.quitLoginPage();
|
||||
// MvpPre.oauthLogin(null, tokenRet.getToken(), 4);
|
||||
LogUtils.e("@@@",tokenRet.getToken());
|
||||
MvpPre.oauthLogin(tokenRet.getToken());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
go2Login();
|
||||
@@ -277,20 +282,22 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
|
||||
};
|
||||
|
||||
try {
|
||||
phoneNumberAuthHelper = PhoneNumberAuthHelper.getInstance(getApplicationContext(),tokenResultListener);
|
||||
phoneNumberAuthHelper = PhoneNumberAuthHelper.getInstance(getApplicationContext(), null);
|
||||
phoneNumberAuthHelper.getReporter().setLoggerEnable(true);
|
||||
LogUtils.e("initAuthSDK", ((AppContext) getApplication()).getCurrentEnvironment().getALI_AUTH_KEY());
|
||||
phoneNumberAuthHelper.setAuthSDKInfo("6rdWuz058oq5OahdbFiGEybUcdahd12J83L34Uc7MrPIrxtFG+rXiwDvRcqNvjwbClbbmvMrmxKVkIysFByBsl0Qe9kqd2w8T/nhK5G6eXXlk2V9AjYCieIU+jRnjZBB+Cfechr6rCGJ2aeBARIsXcRPW7wm9WFK9euh5T+v6Pyte68yNaNdcYCll3+U4/uCEog7HygCnMIbAU+kqoPdmn2H+51YOHW+VsnsHd4w1+I3f8Tt0xLIXGM4GWnQueZ5GR46GTWiSYMy8dCIh9SPIMRyC91GosVcfGPMJSdcXqc=");
|
||||
// phoneNumberAuthHelper.setAuthSDKInfo("6rdWuz058oq5OahdbFiGEybUcdahd12J83L34Uc7MrPIrxtFG+rXiwDvRcqNvjwbClbbmvMrmxKVkIysFByBsl0Qe9kqd2w8T/nhK5G6eXXlk2V9AjYCieIU+jRnjZBB+Cfechr6rCGJ2aeBARIsXcRPW7wm9WFK9euh5T+v6Pyte68yNaNdcYCll3+U4/uCEog7HygCnMIbAU+kqoPdmn2H+51YOHW+VsnsHd4w1+I3f8Tt0xLIXGM4GWnQueZ5GR46GTWiSYMy8dCIh9SPIMRyC91GosVcfGPMJSdcXqc=");
|
||||
phoneNumberAuthHelper.setAuthSDKInfo(((AppContext) getApplication()).getCurrentEnvironment().getALI_AUTH_KEY());
|
||||
phoneNumberAuthHelper.checkEnvAvailable(2);
|
||||
|
||||
} catch (Throwable ignored) {
|
||||
Logger.e("initAuthSDK", ignored);
|
||||
}
|
||||
}
|
||||
|
||||
private void go2Login() {
|
||||
startActivity(new Intent(this, PasswordLoginActivity.class));
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_launch_page;
|
||||
@@ -298,7 +305,7 @@ public class LaunchPageActivity extends BaseMvpActivity<LaunchPresenter, Activit
|
||||
|
||||
@Override
|
||||
protected LaunchPresenter bindPresenter() {
|
||||
return new LaunchPresenter( this,this);
|
||||
return new LaunchPresenter(this, this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user