Commit 646724d8 authored by mengcuiguang's avatar mengcuiguang

账号合并优化

parent 9eb48dbe
...@@ -38,7 +38,7 @@ public class AccountMsgBean implements Serializable { ...@@ -38,7 +38,7 @@ public class AccountMsgBean implements Serializable {
this.wxUser = wxUser; this.wxUser = wxUser;
} }
public static class MobileUserBean implements Serializable { public class MobileUserBean implements Serializable {
/** /**
* head : null * head : null
* contribution : 0 * contribution : 0
...@@ -94,7 +94,7 @@ public class AccountMsgBean implements Serializable { ...@@ -94,7 +94,7 @@ public class AccountMsgBean implements Serializable {
} }
} }
public static class WxUserBean implements Serializable { public class WxUserBean implements Serializable {
/** /**
* head : https://thirdwx.qlogo.cn/mmopen/vi_32/zo9QSE4Hgv2M2zGLTyTHyyaM6SKxKkIeJJhU0nxNZxXGAQV0SnBKwqfXkspujZjI23tvgWBJMqlziaq5Cw7r0vg/132 * head : https://thirdwx.qlogo.cn/mmopen/vi_32/zo9QSE4Hgv2M2zGLTyTHyyaM6SKxKkIeJJhU0nxNZxXGAQV0SnBKwqfXkspujZjI23tvgWBJMqlziaq5Cw7r0vg/132
* contribution : 0 * contribution : 0
......
...@@ -2,8 +2,10 @@ package com.mints.goodmoney.mvp.presenters ...@@ -2,8 +2,10 @@ package com.mints.goodmoney.mvp.presenters
import com.google.gson.JsonObject import com.google.gson.JsonObject
import com.mints.goodmoney.manager.AppHttpManager import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.AccountMsgBean import com.mints.goodmoney.mvp.model.AccountMsgBean
import com.mints.goodmoney.mvp.model.BaseResponse import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.UserBean
import com.mints.goodmoney.mvp.views.AccountMergeView import com.mints.goodmoney.mvp.views.AccountMergeView
import com.mints.library.net.neterror.BaseSubscriber import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable import com.mints.library.net.neterror.Throwable
...@@ -51,19 +53,20 @@ class AccountMergePresenter : BasePresenter<AccountMergeView>() { ...@@ -51,19 +53,20 @@ class AccountMergePresenter : BasePresenter<AccountMergeView>() {
vo["saveType"] = saveType vo["saveType"] = saveType
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.toKeepAccount(vo), .call(loanService.toKeepAccount(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() { object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() { override fun onCompleted() {
} }
override fun onError(e: Throwable) { override fun onError(e: Throwable) {
} }
override fun onNext(baseResponse: BaseResponse<JsonObject>) { override fun onNext(baseResponse: BaseResponse<UserBean>) {
val code = baseResponse.status val code = baseResponse.status
val message = baseResponse.message val message = baseResponse.message
when (code) { when (code) {
200 -> { 200 -> if (baseResponse.data != null) {
view.toKeepAccountSuc(saveType) UserManager.getInstance().saveUserInfo(baseResponse.data)
view.toKeepAccountSuc()
} }
else -> { else -> {
view.showToast(message) view.showToast(message)
......
...@@ -7,7 +7,7 @@ interface AccountMergeView : BaseView { ...@@ -7,7 +7,7 @@ interface AccountMergeView : BaseView {
fun getKeepAccountMsgSuc(data: AccountMsgBean) fun getKeepAccountMsgSuc(data: AccountMsgBean)
fun getKeepAccountMsgFail() fun getKeepAccountMsgFail()
fun toKeepAccountSuc(saveType: Int) fun toKeepAccountSuc()
fun toKeepAccountFail() fun toKeepAccountFail()
} }
\ No newline at end of file
...@@ -426,7 +426,7 @@ public interface LoanService { ...@@ -426,7 +426,7 @@ public interface LoanService {
* @return * @return
*/ */
@POST("api/toKeepAccount") @POST("api/toKeepAccount")
Observable<BaseResponse<Object>> toKeepAccount(@Body Map<String, Object> vo); Observable<BaseResponse<UserBean>> toKeepAccount(@Body Map<String, Object> vo);
/** /**
......
...@@ -138,7 +138,7 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV ...@@ -138,7 +138,7 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV
override fun getKeepAccountMsgFail() {} override fun getKeepAccountMsgFail() {}
override fun toKeepAccountSuc(saveType: Int) { override fun toKeepAccountSuc() {
showToast("账号合并成功!") showToast("账号合并成功!")
......
...@@ -113,8 +113,6 @@ class BindWxDialog(context: Activity) : ...@@ -113,8 +113,6 @@ class BindWxDialog(context: Activity) :
bundle.putString(Constant.MERGE_WXOPENID, wxOpenId) bundle.putString(Constant.MERGE_WXOPENID, wxOpenId)
bundle.putString(Constant.MERGE_KEY, key) bundle.putString(Constant.MERGE_KEY, key)
readyGo(AccountMergeActivity::class.java, bundle) readyGo(AccountMergeActivity::class.java, bundle)
dismiss()
} }
protected fun readyGo(clazz: Class<*>?, bundle: Bundle?) { protected fun readyGo(clazz: Class<*>?, bundle: Bundle?) {
......
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