1:修改交友房出现嘉宾会闭麦的情况
This commit is contained in:
@@ -62,6 +62,7 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
public PhoneNumberAuthHelper phoneNumberAuthHelper;
|
||||
private TokenResultListener tokenResultListener;
|
||||
private boolean canOnePass;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
@@ -71,6 +72,7 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_password_login;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
// 检查是否已经创建过该Activity
|
||||
@@ -91,6 +93,7 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
// EventBus.getDefault().register(this);
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A0101);
|
||||
}
|
||||
|
||||
private void checkAppVersion() {
|
||||
// 获取当前版本号
|
||||
int currentVersionCode = 0;
|
||||
@@ -126,7 +129,7 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
if (phoneNumberAuthHelper!=null) {
|
||||
if (phoneNumberAuthHelper != null) {
|
||||
phoneNumberAuthHelper.hideLoginLoading();
|
||||
//获取成功 dimiss就去登录、登录成功
|
||||
phoneNumberAuthHelper.quitLoginPage();
|
||||
@@ -192,10 +195,10 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
mBinding.tvSendCode.setOnClickListener(this::onClick);
|
||||
mBinding.ivEye.setOnClickListener(this::onClick);
|
||||
|
||||
if (mBinding.tvCodeText.getText().equals("切换密码登录")){
|
||||
type=1;
|
||||
}else {
|
||||
type=2;
|
||||
if (mBinding.tvCodeText.getText().equals("切换密码登录")) {
|
||||
type = 1;
|
||||
} else {
|
||||
type = 2;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -213,7 +216,7 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
tokenRet = JSON.parseObject(s, TokenRet.class);
|
||||
if (tokenRet != null && ("600000").equals(tokenRet.getCode())) {
|
||||
|
||||
LogUtils.e("@@@",tokenRet.getToken());
|
||||
LogUtils.e("@@@", tokenRet.getToken());
|
||||
MvpPre.oauthLoginLogin(tokenRet.getToken());
|
||||
// phoneNumberAuthHelper.hideLoginLoading();
|
||||
// //获取成功 dimiss就去登录、登录成功
|
||||
@@ -252,9 +255,8 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void checkOnePass() {
|
||||
if (!TextUtils.isEmpty(CommonAppContext.getInstance().getToken()) && !TextUtils.isEmpty(CommonAppContext.getInstance().getUser().getTencent_im())) {
|
||||
if (!TextUtils.isEmpty(CommonAppContext.getInstance().getToken()) && !TextUtils.isEmpty(CommonAppContext.getInstance().getUser().getTencent_im())) {
|
||||
isRoot();
|
||||
return;
|
||||
}
|
||||
@@ -398,8 +400,8 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
.setSwitchAccTextSize(12)
|
||||
.setSwitchOffsetY(390)
|
||||
//协议栏
|
||||
.setAppPrivacyOne("《用户协议》", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6")
|
||||
.setAppPrivacyTwo("《隐私协议》", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4")
|
||||
.setAppPrivacyOne("《用户协议》", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6")
|
||||
.setAppPrivacyTwo("《隐私协议》", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4")
|
||||
.setAppPrivacyColor(Color.parseColor("#000000"), Color.parseColor("#22BB79"))
|
||||
.setPrivacyBefore("登录即代表同意")
|
||||
.setPrivacyEnd("并授权获得号码")
|
||||
@@ -431,7 +433,6 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void showLoadings() {
|
||||
showLoading();
|
||||
@@ -462,23 +463,22 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
// startActivity(intent);
|
||||
// finish();
|
||||
|
||||
if (mBinding.tvCodeText.getText().equals("切换密码登录")){
|
||||
if (mBinding.tvCodeText.getText().equals("切换密码登录")) {
|
||||
mBinding.rlPassCode.setVisibility(VISIBLE);
|
||||
mBinding.rlCode.setVisibility(View.GONE);
|
||||
mBinding.tvCodeText.setText("切换验证码登录");
|
||||
mBinding.tvLoginText.setText("密码登录");
|
||||
type=2;
|
||||
}else {
|
||||
type = 2;
|
||||
} else {
|
||||
mBinding.rlPassCode.setVisibility(View.GONE);
|
||||
mBinding.rlCode.setVisibility(VISIBLE);
|
||||
mBinding.tvCodeText.setText("切换密码登录");
|
||||
mBinding.tvLoginText.setText("验证码登录");
|
||||
type=1;
|
||||
type = 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (id == R.id.fl_login) {
|
||||
} else if (id == R.id.fl_login) {
|
||||
if (!mBinding.cbPrivacy.isChecked()) {
|
||||
ToastUtils.show("请先勾选服务条款");
|
||||
return;
|
||||
@@ -488,14 +488,14 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("请输入手机号");
|
||||
return;
|
||||
}
|
||||
if (type==1) {
|
||||
if (type == 1) {
|
||||
String code = mBinding.edPassword.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(code)) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("请输入验证码");
|
||||
return;
|
||||
}
|
||||
MvpPre.login(phone, "", code, 1);
|
||||
}else if (type==2) {
|
||||
} else if (type == 2) {
|
||||
String password = mBinding.edPasswordCode.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(password)) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("请输入密码");
|
||||
@@ -530,7 +530,7 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
}
|
||||
sendCodeSuccess(phone);
|
||||
MvpPre.sendCode(phone, 1);
|
||||
}else if (id == R.id.iv_eye) {
|
||||
} else if (id == R.id.iv_eye) {
|
||||
|
||||
if (!isPasswordVisible) {
|
||||
mBinding.edPassword.setInputType(android.text.InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
|
||||
@@ -544,11 +544,12 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
isPasswordVisible = !isPasswordVisible; // 切换状态
|
||||
}
|
||||
}
|
||||
|
||||
private void wcLogin() {
|
||||
//发起登陆请求前先注册微信api
|
||||
IWXAPI api = WXAPIFactory.createWXAPI(this,CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId(),true);
|
||||
IWXAPI api = WXAPIFactory.createWXAPI(this, CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId(), true);
|
||||
api.registerApp(CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId());
|
||||
if (!api.isWXAppInstalled()){
|
||||
if (!api.isWXAppInstalled()) {
|
||||
//todo 提醒未安装微信
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("请安装微信客户端");
|
||||
return;
|
||||
@@ -562,12 +563,13 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void loginEvent(BaseResp event) {
|
||||
if (event.errCode ==BaseResp.ErrCode.ERR_OK){
|
||||
SendAuth.Resp authResp = (SendAuth.Resp)event;
|
||||
LogUtils.e("@@@",authResp.code);
|
||||
MvpPre.oauthLogin(authResp.code,1);
|
||||
if (event.errCode == BaseResp.ErrCode.ERR_OK) {
|
||||
SendAuth.Resp authResp = (SendAuth.Resp) event;
|
||||
LogUtils.e("@@@", authResp.code);
|
||||
MvpPre.oauthLogin(authResp.code, 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void releaseTimer() {
|
||||
if (mTimer != null) {
|
||||
mTimer.cancel();
|
||||
@@ -627,9 +629,9 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
}
|
||||
|
||||
private void zfbLogin(String s) {
|
||||
LogUtils.e("@@@",s);
|
||||
LogUtils.e("@@@", s);
|
||||
CommonAppContext.getInstance();
|
||||
if (!CommonAppContext.isAlipayInstalled(this)){
|
||||
if (!CommonAppContext.isAlipayInstalled(this)) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("请安装支付宝客户端");
|
||||
return;
|
||||
}
|
||||
@@ -644,14 +646,14 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
// 调用授权接口,获取授权结果
|
||||
Map<String, String> result = authTask.authV2(authInfo, true);
|
||||
LogUtils.e(result);
|
||||
if (result.get("resultStatus").equals("9000")){
|
||||
if (result.get("resultStatus").equals("9000")) {
|
||||
Pattern pattern = Pattern.compile("auth_code=([^&]*)");
|
||||
Matcher matcher = pattern.matcher(result.get("result"));
|
||||
|
||||
if (matcher.find()) {
|
||||
String authCode = matcher.group(1);
|
||||
LogUtils.e("AuthCode", authCode);
|
||||
MvpPre.oauthLogin(authCode,2);
|
||||
MvpPre.oauthLogin(authCode, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user