Commit ab8e344a by 刘鹏

Merge branch 'd/v_accountLogOff' into 'release'

注销登录功能合并

See merge request app_android_lib/YDL-Component!163
parents ee3dbe51 f54cbd9c
...@@ -20,10 +20,10 @@ import java.util.List; ...@@ -20,10 +20,10 @@ import java.util.List;
*/ */
public final class DemoGlobalConfig implements IConfigModule { public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/"; String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
public static String appEnv = YDLConstants.ENV_TEST; public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
// public static String appEnv = YDLConstants.ENV_PROD; // public static String appEnv = YDLConstants.ENV_PROD;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
@Override @Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) { public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles()); lifecycles.add(new DemoAppLifecycles());
......
...@@ -8,7 +8,7 @@ ext { ...@@ -8,7 +8,7 @@ ext {
"m-confide" : "0.0.50.25", "m-confide" : "0.0.50.25",
"m-consultant" : "0.0.60.67", "m-consultant" : "0.0.60.67",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.48", "m-user" : "0.0.62.49",
"m-home" : "0.0.23.90", "m-home" : "0.0.23.90",
"m-im" : "0.0.21.57", "m-im" : "0.0.21.57",
"m-dynamic" : "0.0.7.74", "m-dynamic" : "0.0.7.74",
...@@ -35,7 +35,6 @@ ext { ...@@ -35,7 +35,6 @@ ext {
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.23", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.41.39", "ydl-platform" : "0.0.41.39",
//第二步 若干 //第二步 若干
...@@ -44,9 +43,6 @@ ext { ...@@ -44,9 +43,6 @@ ext {
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.30.18", "m-audioim" : "0.0.49.30.18",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
...@@ -97,7 +93,7 @@ ext { ...@@ -97,7 +93,7 @@ ext {
"m-confide" : "0.0.50.25", "m-confide" : "0.0.50.25",
"m-consultant" : "0.0.60.67", "m-consultant" : "0.0.60.67",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.48", "m-user" : "0.0.62.49",
"m-home" : "0.0.23.90", "m-home" : "0.0.23.90",
"m-im" : "0.0.21.57", "m-im" : "0.0.21.57",
"m-dynamic" : "0.0.7.74", "m-dynamic" : "0.0.7.74",
......
...@@ -229,13 +229,22 @@ interface UserApi { ...@@ -229,13 +229,22 @@ interface UserApi {
fun unBindThirdLogin(@Body body: RequestBody): Observable<BaseResponse<Any>> fun unBindThirdLogin(@Body body: RequestBody): Observable<BaseResponse<Any>>
/** /**
* 用户注销账号 * 用户注销账号(原有禁止登录逻辑)
*/ */
@FormUrlEncoded @FormUrlEncoded
@POST("user/forbid_login") @POST("user/forbid_login")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun userForbidLogin(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<Boolean>> fun userForbidLogin(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<Boolean>>
/**
* 用户注销账号
*/
@FormUrlEncoded
@POST("login/v2/accountLogOff")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun accountLogOff(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<Boolean>>
/** /**
* 是否需要强绑定手机号 * 是否需要强绑定手机号
*/ */
......
...@@ -79,6 +79,9 @@ interface UserHttp { ...@@ -79,6 +79,9 @@ interface UserHttp {
fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>> fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>>
/**用户注销账号*/ /**用户注销账号(禁止登录)*/
fun userForbidLogin(param: UserForbidLoginParam):Observable<BaseAPIResponse<Boolean>> fun userForbidLogin(param: UserForbidLoginParam):Observable<BaseAPIResponse<Boolean>>
/**用户注销账号*/
fun accountLogOff(param: UserForbidLoginParam):Observable<BaseAPIResponse<Boolean>>
} }
\ No newline at end of file
...@@ -231,13 +231,21 @@ class UserHttpImpl private constructor() : UserHttp { ...@@ -231,13 +231,21 @@ class UserHttpImpl private constructor() : UserHttp {
} }
/** /**
* 用户注销账号调用接口 * 用户注销账号调用接口(禁止登陆)
* */ * */
override fun userForbidLogin(param: UserForbidLoginParam): Observable<BaseAPIResponse<Boolean>> { override fun userForbidLogin(param: UserForbidLoginParam): Observable<BaseAPIResponse<Boolean>> {
return RxUtils.mapObservable(param) return RxUtils.mapObservable(param)
.flatMap { getUserApi().userForbidLogin(it) } .flatMap { getUserApi().userForbidLogin(it) }
} }
/**
* 用户注销账号调用接口
* */
override fun accountLogOff(param: UserForbidLoginParam): Observable<BaseAPIResponse<Boolean>> {
return RxUtils.mapObservable(param)
.flatMap { getUserApi().accountLogOff(it) }
}
private object Holder { private object Holder {
val INSTANCE = UserHttpImpl() val INSTANCE = UserHttpImpl()
} }
......
...@@ -38,9 +38,10 @@ class AccountUnRegisterActivity : BaseActivity() { ...@@ -38,9 +38,10 @@ class AccountUnRegisterActivity : BaseActivity() {
.setTitle_color(R.color.platform_color_242424) .setTitle_color(R.color.platform_color_242424)
.setMessage( .setMessage(
""" """
1.您的账号内如有剩余金额,如未用完,视为放弃将被清零; 为了保护您的账户、财产安全,在您提交注销前,需同时满足以下条件:
1.账号财产已清零,即账户余额为0;
2.您的订单(已购买的咨询、课程、测评等)将被终止且无法继续接受服务; 2.不存在交易中的订单,即咨询订单状态均为交易成功或交易关闭;
3.无退款中的订单。
""".trimIndent() """.trimIndent()
) )
.setMessageTextGravity(Gravity.LEFT) .setMessageTextGravity(Gravity.LEFT)
...@@ -60,15 +61,18 @@ class AccountUnRegisterActivity : BaseActivity() { ...@@ -60,15 +61,18 @@ class AccountUnRegisterActivity : BaseActivity() {
private fun userForbidLogin() { private fun userForbidLogin() {
val param = UserForbidLoginParam() val param = UserForbidLoginParam()
param.userPort = 1; param.userPort = 1;
UserHttpImpl.getInstance().userForbidLogin(param) UserHttpImpl.getInstance().accountLogOff(param)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe { .subscribe {
if (!isFinishing && it.data) { if (it.code == "200" && !isFinishing && it.data) {
ToastUtil.toastShort("账号已注销") ToastUtil.toastLong(this@AccountUnRegisterActivity,"账号已注销")
EventBus.getDefault().post(UnRegisterEvent()) EventBus.getDefault().post(UnRegisterEvent())
finish() finish()
} else {
ToastUtil.toastLong(this@AccountUnRegisterActivity,it.msg)
} }
} }
} }
} }
\ No newline at end of file
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