手机号加密处理

This commit is contained in:
huangjian
2022-04-01 16:34:25 +08:00
parent e2d0e38d4b
commit cc3e7c9b71
4 changed files with 18 additions and 19 deletions

View File

@@ -263,10 +263,10 @@ public class AuthModel extends BaseModel implements IAuthModel {
//获取登录信息
try {
LoginResult loginResult = api.login(
account,
DESUtils.DESAndBase64(account),
VersionUtil.getLocalName(BasicConfig.INSTANCE.getAppContext()),
"erban-client",
account,
DESUtils.DESAndBase64(account),
DESAndBase64(password),
"password",
"uyzjdhds",
@@ -712,7 +712,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
public void subscribe(SingleEmitter<String> emitter) throws Exception {
try {
ServiceResult serviceResult = api.requestSMSCode(
phone,
DESUtils.DESAndBase64(phone),
String.valueOf(type)
).blockingGet();
if (!serviceResult.isSuccess()) {
@@ -743,7 +743,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
public void subscribe(SingleEmitter<String> e) throws Exception {
try {
ServiceResult serviceResult = api.requestResetPsw(
phone,
DESUtils.DESAndBase64(phone),
sms_code,
DESAndBase64(newPsw)
).blockingGet();
@@ -805,7 +805,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
}
return api.bindPhone(
String.valueOf(currentAccountInfo.getUid()),
phone,
DESUtils.DESAndBase64(phone),
code,
getTicket()
)
@@ -872,7 +872,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
linkedmeChannel = linkedInfo.getChannel();
}
return api.register(
phone,
DESUtils.DESAndBase64(phone),
sms_code,
verifyCode,
DESAndBase64(password),
@@ -962,7 +962,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
return Single.error(new Throwable("没有ticket信息"));
}
return api.changeLoginPwd(
phone,
DESUtils.DESAndBase64(phone),
oldPwd,
newPwd,
getTicket()
@@ -1000,7 +1000,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
}
return api.setLoginPwd(
phone,
DESUtils.DESAndBase64(phone),
newPwd,
String.valueOf(getCurrentUid()),
getTicket()
@@ -1168,7 +1168,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
* @return
*/
public Single<String> sendLoginCode(String phone, int type) {
return api.sendCode(phone, String.valueOf(type))
return api.sendCode(DESUtils.DESAndBase64(phone), String.valueOf(type))
.subscribeOn(Schedulers.io())
.map(objectServiceResult -> {
if (!objectServiceResult.isSuccess()) {

View File

@@ -1,18 +1,18 @@
package com.yizhuan.xchat_android_core.pay;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_ACCOUNT;
import android.content.Context;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import com.yizhuan.xchat_android_core.auth.AuthModel;
import com.yizhuan.xchat_android_core.auth.event.LoginEvent;
import com.yizhuan.xchat_android_core.base.BaseModel;
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
import com.yizhuan.xchat_android_core.bean.response.result.ChargeListResult;
import com.yizhuan.xchat_android_core.bean.response.result.WalletInfoResult;
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
import com.yizhuan.xchat_android_core.manager.RoomEvent;
import com.yizhuan.xchat_android_core.pay.bean.ChargeBean;
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeGoods;
import com.yizhuan.xchat_android_core.pay.bean.WalletInfo;
import com.yizhuan.xchat_android_core.pay.bean.WxPayType;
@@ -23,8 +23,8 @@ import com.yizhuan.xchat_android_core.pay.event.UpdateWalletInfoEvent;
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent;
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
import com.yizhuan.xchat_android_library.utils.LogUtil;
import com.yizhuan.xchat_android_library.utils.NetworkUtils;
import com.yizhuan.xchat_android_library.utils.codec.DESUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@@ -43,8 +43,6 @@ import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_ACCOUNT;
/**
* 实现网络的方法
* Created by zhouxiangfeng on 2017/6/19.
@@ -259,7 +257,7 @@ public class PayModel extends BaseModel implements IPayModel {
long uid,
String ticket,
String type) {
return api.getCode(mobile, checkExists, uid, ticket, type)
return api.getCode(DESUtils.DESAndBase64(mobile), checkExists, uid, ticket, type)
.compose(RxHelper.handleSchedulers());
}
@@ -274,7 +272,7 @@ public class PayModel extends BaseModel implements IPayModel {
@Override
public Single<String> verifyCode(String mobile,
String code) {
return api.verifyCode(mobile, code)
return api.verifyCode(DESUtils.DESAndBase64(mobile), code)
.flatMap(new Function<ServiceResult<String>, SingleSource<String>>() {
@Override
public SingleSource<String> apply(ServiceResult<String> stringServiceResult) throws Exception {

View File

@@ -6,6 +6,7 @@ import com.yizhuan.xchat_android_core.auth.AuthModel;
import com.yizhuan.xchat_android_core.base.BaseModel;
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
import com.yizhuan.xchat_android_library.utils.codec.DESUtils;
import io.reactivex.Single;
import io.reactivex.SingleSource;
@@ -39,7 +40,7 @@ public class CodeModel extends BaseModel implements ICodeModel {
*/
@Override
public Single<String> sendCode(String phone, int type) {
return api.code(phone, AuthModel.get().getCurrentUid(), type)
return api.code(DESUtils.DESAndBase64(phone), AuthModel.get().getCurrentUid(), type)
.onErrorResumeNext(this.getSingleCommonExceptionFunction())
.flatMap(new Function<ServiceResult<String>, SingleSource<String>>() {
@Override