d
This commit is contained in:
@@ -12,7 +12,7 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.fenghoo.seven.main.entity.mine.TreeUserEntity;
|
||||
import com.fenghoo.seven.main.my.entity.loginInfoBean;
|
||||
import com.fenghoo.seven.main.entity.mine.WeChatLoginEntity;
|
||||
import com.fenghoo.seven.main.entity.mine.WeChatLoginResultEntity;
|
||||
import com.fenghoo.seven.network.ApiUtils;
|
||||
@@ -44,17 +44,17 @@ import io.reactivex.schedulers.Schedulers;
|
||||
public class WXEntryActivity extends WechatHandlerActivity implements IWXAPIEventHandler {
|
||||
public static final String WEIXIN_APP_ID = "wxaa49732bd3a29bec";
|
||||
private static final String APP_SECRET = "038324288450b5dcb610915fea7fb1af";
|
||||
private static ObservableEmitter<ResponseBean<TreeUserEntity>> mE;
|
||||
private static ObservableEmitter<ResponseBean<loginInfoBean>> mE;
|
||||
private IWXAPI mWeixinAPI;
|
||||
/**
|
||||
* 微信登陆数据
|
||||
*/
|
||||
private WeChatLoginEntity mEntity;
|
||||
|
||||
public static Observable<ResponseBean<TreeUserEntity>> getObservable() {
|
||||
return Observable.create(new ObservableOnSubscribe<ResponseBean<TreeUserEntity>>() {
|
||||
public static Observable<ResponseBean<loginInfoBean>> getObservable() {
|
||||
return Observable.create(new ObservableOnSubscribe<ResponseBean<loginInfoBean>>() {
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<ResponseBean<TreeUserEntity>> e) throws Exception {
|
||||
public void subscribe(@NonNull ObservableEmitter<ResponseBean<loginInfoBean>> e) throws Exception {
|
||||
mE = e;
|
||||
}
|
||||
});
|
||||
@@ -129,9 +129,9 @@ public class WXEntryActivity extends WechatHandlerActivity implements IWXAPIEven
|
||||
}
|
||||
})
|
||||
//用户资料登陆
|
||||
.flatMap(new Function<WeChatLoginEntity, ObservableSource<ResponseBean<TreeUserEntity>>>() {
|
||||
.flatMap(new Function<WeChatLoginEntity, ObservableSource<ResponseBean<loginInfoBean>>>() {
|
||||
@Override
|
||||
public ObservableSource<ResponseBean<TreeUserEntity>> apply(@NonNull WeChatLoginEntity entity) throws Exception {
|
||||
public ObservableSource<ResponseBean<loginInfoBean>> apply(@NonNull WeChatLoginEntity entity) throws Exception {
|
||||
|
||||
if (ProfileSpUtils.getInstance().isLogin()) {
|
||||
//绑定微信
|
||||
@@ -156,9 +156,9 @@ public class WXEntryActivity extends WechatHandlerActivity implements IWXAPIEven
|
||||
}
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseBean<TreeUserEntity>>() {
|
||||
.subscribe(new Consumer<ResponseBean<loginInfoBean>>() {
|
||||
@Override
|
||||
public void accept(@NonNull ResponseBean<TreeUserEntity> treeUserEntityResponseBean) throws Exception {
|
||||
public void accept(@NonNull ResponseBean<loginInfoBean> treeUserEntityResponseBean) throws Exception {
|
||||
mE.onNext(treeUserEntityResponseBean);
|
||||
mE.onComplete();
|
||||
finish();
|
||||
|
||||
Reference in New Issue
Block a user