Commit 863a07ce by 刘鹏

Merge remote-tracking branch 'origin/release' into release

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