Commit 23d224b4 by 刘鹏

feat : user模块代码提交

parent eae736e4
......@@ -17,6 +17,13 @@ modular {
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
medical{
groupId = "com.ydl"
artifactId = "m-user-module-medical"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
......
......@@ -35,8 +35,8 @@ class LoginApiRequestUtil {
/**
* 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定
*/
fun checkPhoneStatus(phone: String, countryCode: String?): Observable<BaseResponse<ChcekPhoneResponeBean>> {
return getUserApi().checkPhoneStatus(phone, countryCode!!)
fun checkPhoneStatus(phone: String, countryCode: String?,gatewayUrl :String): Observable<BaseResponse<ChcekPhoneResponeBean>> {
return getUserApi().checkPhoneStatus(phone, countryCode!!,gatewayUrl)
}
/**
......@@ -78,8 +78,8 @@ class LoginApiRequestUtil {
/**
* 发送登录验证码
*/
fun sendLoginMsgCode(phone: String, countryCode: String): Observable<BaseResponse<Any>> {
return getUserApi().sendLoginMsgCode(phone, countryCode)
fun sendLoginMsgCode(phone: String, countryCode: String,gatewayUrl:String): Observable<BaseResponse<Any>> {
return getUserApi().sendLoginMsgCode(phone, countryCode,gatewayUrl)
}
/**
......
package com.yidianling.user.http
import com.google.gson.internal.LinkedTreeMap
import com.ydl.ydlcommon.base.config.*
import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_LOGIN_BASE_URL
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean
......@@ -26,9 +29,9 @@ interface UserApi {
fun login(@FieldMap params: Map<String, String>): Observable<BaseResponse<UserResponseBean>>
//国家列表
@FormUrlEncoded
@POST("user/country-list")
fun countryList(@Field(YDLConstants.HOLDER_PARAM ) params: String): Observable<BaseResponse<CountryResponse>>
@GET("ydl-yiliao-api/api/client/login/v1/get_country_code_list")
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun countryList(@Query("gatewayUrl") gatewayUrl: String): Observable<BaseResponse<List<CountryResponse>>>
//判断手机号是否存在
@FormUrlEncoded
......@@ -57,11 +60,10 @@ interface UserApi {
//设置推送的channelId
@POST("user/device/modify")
@Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA)
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun setChannelId(@Body body: RequestBody): Observable<BaseResponse<LinkedTreeMap<String, String>>>
//设置用户信息
@FormUrlEncoded
@POST("user/set-info")
......@@ -94,7 +96,7 @@ interface UserApi {
//登出
@FormUrlEncoded
@POST("user/logout")
@POST("ydl-yiliao-api/api/client/login/v1/logout")
fun logout(@FieldMap params: Map<String, String>): Observable<BaseResponse<Any>>
//更换手机时密码验证
......@@ -109,11 +111,10 @@ interface UserApi {
//同意隐私政策接口
@GET("user/agreePrivacyAgreement")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun privacyAgree(@Query("uid") uid: String): Observable<BaseResponse<Any>>
//服务端校验阿里一键认证
@POST("phone/verification/init")
fun checkAliAuth(@Body body: RequestBody): Observable<BaseResponse<PhoneAuthResponseBean>>
......@@ -130,101 +131,116 @@ interface UserApi {
//上传用户信息数据接口
@POST("user/collect/submit")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun uploadUserInfo(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
//获取关注问题数据接口
@GET("cate/list-parentId")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getFocusData(@Query("parentId") parentId: String = "0"): Observable<BaseAPIResponse<List<CollectFocusItemBean>>>
//获取新用户引导页面url
@FormUrlEncoded
@POST("user/getNewUserJumpUrl")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getNewUserJumpUrl(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<String>> //获取新用户引导页面url
//第三方登录获取用户信息
@POST("login/v2/login_wechat_qq")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT)
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun thirdPartJavaLogin(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/**
* 绑定手机号
*/
@POST("login/v2/bind_phone")
@Headers(YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun bindPhone(@Body body: RequestBody): Observable<BaseResponse<Any>>
/**
* 一键登录和本机号码校验
*/
@POST("login/v2/login_direct")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun autoLogin(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/**
* 密码登录
*/
@POST("login/v2/login_pwd")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT)
@POST("ydl-yiliao-api/api/client/login/v1/login_pwd")
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun loginByPassword(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/**
* 验证码登录
*/
@POST("login/v2/login_sms")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT)
@POST("ydl-yiliao-api/api/client/login/v1/login_sms")
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun loginByMsgCode(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/**
* 第三方登录
*/
@POST("login/v2/login_wechat_qq")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT)
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun thirdPartyLogin(@Body body: RequestBody): Observable<BaseAPIResponse<UserResponseBean>>
/**
* 检查手机号来源
*/
@GET("login/v2/phone_detection")
@Headers(YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT)
fun checkPhoneStatus(@Query("phone") phone: String, @Query("countryCode") countryCode: String): Observable<BaseResponse<ChcekPhoneResponeBean>>
@GET("ydl-yiliao-api/api/client/login/v1/phone_detection")
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun checkPhoneStatus(
@Query("phone") phone: String,
@Query("countryCode") countryCode: String,
@Query("gatewayUrl") gatewayUrl: String
): Observable<BaseResponse<ChcekPhoneResponeBean>>
/**
* 验证重置密码的短信验证码
*/
@GET("login/v2/pre_check_reset_sms")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT)
fun checkResetCode(@Query("phone") phone: String, @Query("countryCode") countryCode: String, @Query("code") code: String): Observable<BaseResponse<Any>>
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun checkResetCode(
@Query("phone") phone: String,
@Query("countryCode") countryCode: String,
@Query("code") code: String
): Observable<BaseResponse<Any>>
/**
* 重置密码
*/
@POST("login/v2/reset_pwd")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun resetPwd(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/**
* 发送登录验证码
*/
@GET("login/v2/send_login_sms")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun sendLoginMsgCode(@Query("phone") phone: String, @Query("countryCode") countryCode: String): Observable<BaseResponse<Any>>
@GET("ydl-yiliao-api/api/client/login/v1/send_login_sms")
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun sendLoginMsgCode(
@Query("phone") phone: String,
@Query("countryCode") countryCode: String,
@Query("gatewayUrl") gatewayUrl: String
): Observable<BaseResponse<Any>>
/**
* 发送忘记密码重置密码的验证码
*/
@GET("login/v2/send_reset_sms")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT)
fun sendResetCode(@Query("phone") phone: String, @Query("countryCode") countryCode: String): Observable<BaseResponse<Any>>
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun sendResetCode(
@Query("phone") phone: String,
@Query("countryCode") countryCode: String
): Observable<BaseResponse<Any>>
/**
* 第三方登录解绑
*/
@POST("login/v2/unbind_wechat_qq")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT)
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun unBindThirdLogin(@Body body: RequestBody): Observable<BaseResponse<Any>>
/**
......@@ -232,13 +248,13 @@ interface UserApi {
*/
@FormUrlEncoded
@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>>
/**
* 是否需要强绑定手机号
*/
@POST("login/v2/is_need_strong_bind")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun isNeedForceBindPhone(@Body map: Map<String,String>): Observable<BaseAPIResponse<Boolean>>
@Headers(YDL_DOMAIN + YDL_DOMAIN_LOGIN_BASE_URL, LOGIN_USER_PORT)
fun isNeedForceBindPhone(@Body map: Map<String, String>): Observable<BaseAPIResponse<Boolean>>
}
\ No newline at end of file
......@@ -28,7 +28,7 @@ interface UserHttp {
fun login(param: LoginParam): Observable<BaseResponse<UserResponseBean>>
fun countryList(): Observable<BaseResponse<CountryResponse>>
fun countryList(gatewayUrl:String): Observable<BaseResponse<List<CountryResponse>>>
fun phoneExist(param: ExistParam): Observable<BaseResponse<ExistResponse>>
......
......@@ -66,8 +66,8 @@ class UserHttpImpl private constructor() : UserHttp {
.flatMap { getUserApi().login(it) }
}
override fun countryList(): Observable<BaseResponse<CountryResponse>> {
return getUserApi().countryList("")
override fun countryList(gatewayUrl:String): Observable<BaseResponse<List<CountryResponse>>> {
return getUserApi().countryList(gatewayUrl)
.compose(RxUtils.netCheck())
}
......
......@@ -11,5 +11,6 @@ data class PhoneLoginPwdParam(
var password: String,//密码
var countryCode: String,//手机区号
var phoneNumber: String,//手机号
var gatewayUrl: String="",//网关
var type: Int = 2 //Android 端
)
\ No newline at end of file
......@@ -5,9 +5,7 @@ package com.yidianling.user.http.response
* e-mail : zhangwch@yidianling.com
* time : 2018/02/03
*/
data class CountryResponse(val countryList: List<Country>) {
data class Country(val code: String,
val en_name: String,
val name: String)
}
\ No newline at end of file
data class CountryResponse(val countryCode: String,
val en_name: String,
val country: String,
val prefix: String)
\ No newline at end of file
......@@ -13,6 +13,7 @@ import com.umeng.socialize.bean.SHARE_MEDIA;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.modular.ModularServiceManager;
......@@ -122,7 +123,7 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
return;
}
showProgressDialog();
LoginApiRequestUtil.Companion.checkPhoneStatus(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone(), UserHelper.INSTANCE.getUserInfo().getUserInfo().getCountry_code())
LoginApiRequestUtil.Companion.checkPhoneStatus(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone(), UserHelper.INSTANCE.getUserInfo().getUserInfo().getCountry_code(), HttpConfig.Companion.getGET_GATEWAY_BASE_URL())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
......
......@@ -11,7 +11,9 @@ import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
......@@ -20,14 +22,16 @@ import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.yidianling.user.R;
import com.yidianling.user.http.UserHttp;
import com.yidianling.user.http.UserHttpImpl;
import com.yidianling.user.http.response.CountryResponse.Country;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import com.yidianling.user.http.response.CountryResponse;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* 选择国家和地区
......@@ -39,7 +43,7 @@ public class CountryListActivity extends BaseActivity {
String userCountryCode;
private CountryAdapter mAdapter;
private List<Country> list = new ArrayList<>();
private List<CountryResponse> list = new ArrayList<>();
@Override
protected int layoutResId() {
......@@ -77,12 +81,12 @@ public class CountryListActivity extends BaseActivity {
@SuppressLint("CheckResult")
public void getData() {
UserHttp userHttp = UserHttpImpl.Companion.getInstance();
userHttp.countryList()
userHttp.countryList(HttpConfig.Companion.getGET_GATEWAY_BASE_URL())
.subscribeOn(Schedulers.io())
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(countryResponse -> {
list.addAll(countryResponse.getCountryList());
list.addAll(countryResponse);
mAdapter.notifyDataSetChanged();
}, new ThrowableConsumer() {
@Override
......@@ -95,11 +99,11 @@ public class CountryListActivity extends BaseActivity {
public class CountryAdapter extends BaseAdapter {
private List<Country> list;
private List<CountryResponse> list;
private Context context;
private String userCountryCode;
public CountryAdapter(List<Country> list, Context context, String userCountryCode) {
public CountryAdapter(List<CountryResponse> list, Context context, String userCountryCode) {
this.list = list;
this.context = context;
this.userCountryCode = userCountryCode;
......@@ -125,19 +129,19 @@ public class CountryListActivity extends BaseActivity {
View view = LayoutInflater.from(context).inflate(R.layout.user_item_country_phone_code, parent, false);
TextView nameTv = view.findViewById(R.id.tv_name);
TextView codeTv = view.findViewById(R.id.tv_code);
final Country c = list.get(position);
nameTv.setText(c.getName());
codeTv.setText("+" + c.getCode().replace("00", ""));
final CountryResponse c = list.get(position);
nameTv.setText(c.getCountry());
codeTv.setText("+" + c.getPrefix());
if (c.getCode().equals(userCountryCode)) {
if (c.getCountryCode().equals(userCountryCode)) {
nameTv.setTextColor(Color.parseColor("#1DA1F2"));
codeTv.setTextColor(Color.parseColor("#1DA1F2"));
}
view.setOnClickListener(v -> {
Intent i = new Intent();
i.putExtra("code", c.getCode());
i.putExtra("name", c.getName());
i.putExtra("code", c.getCountryCode());
i.putExtra("name", c.getCountry());
i.putExtra("en_name", c.getEn_name());
setResult(45, i);
overridePendingTransition(0, R.anim.platform_slide_out_to_bottom);
......
......@@ -10,6 +10,8 @@ import android.text.TextUtils
import android.text.TextWatcher
import android.view.View
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.config.GET_GATEWAY_BASE_URL
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.yidianling.common.tools.LogUtil
......@@ -173,7 +175,7 @@ class BindPhoneActivity : BaseActivity() {
@SuppressLint("CheckResult")
private fun checkPhoneStatus() {
val phone = et_phone_number.text.toString().replace(" ", "")
LoginApiRequestUtil.checkPhoneStatus(phone, countryCode)
LoginApiRequestUtil.checkPhoneStatus(phone, countryCode, GET_GATEWAY_BASE_URL)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
......@@ -196,7 +198,7 @@ class BindPhoneActivity : BaseActivity() {
*/
@SuppressLint("CheckResult")
private fun getBindPhoneCode(phone: String) {
LoginApiRequestUtil.sendLoginMsgCode(phone, countryCode)
LoginApiRequestUtil.sendLoginMsgCode(phone, countryCode, HttpConfig.Companion.GET_GATEWAY_BASE_URL)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { showProgressDialog() }
......
......@@ -15,6 +15,7 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.meituan.android.walle.WalleChannelReader
import com.umeng.socialize.UMShareAPI
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.PlatformRamImpl
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.StatusBarUtils
......@@ -255,7 +256,9 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if (checkPhone()) {
LogUtil.e("进入checkPhone()")
mPresenter.checkPhoneStatus(userPhoneNumber!!, countryCode!!, false)
mPresenter.checkPhoneStatus(userPhoneNumber!!, countryCode!!, false,
HttpConfig.Companion.GET_GATEWAY_BASE_URL
)
} else {
}
......
......@@ -62,7 +62,7 @@ interface ILoginContract {
/**
* 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定
*/
fun checkPhoneStatus(phone: String, countryCode: String, isBind: Boolean)
fun checkPhoneStatus(phone: String, countryCode: String, isBind: Boolean,gatewayUrl :String)
}
interface Model : IModel {
......@@ -70,7 +70,7 @@ interface ILoginContract {
/**
* 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定
*/
fun checkPhoneStatus(phone: String, countryCode: String): Observable<BaseResponse<ChcekPhoneResponeBean>>
fun checkPhoneStatus(phone: String, countryCode: String,gatewayUrl :String): Observable<BaseResponse<ChcekPhoneResponeBean>>
}
}
......@@ -93,7 +93,7 @@ interface IVerificationCodeContract {
/**
* 发送登录验证码
*/
fun sendLoginMsgCode(phone: String, countryCode: String): Observable<BaseResponse<Any>>
fun sendLoginMsgCode(phone: String, countryCode: String,gatewayUrl:String): Observable<BaseResponse<Any>>
/**
* 验证码验证码登录
......
......@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.model
import android.app.Activity
import com.umeng.socialize.bean.SHARE_MEDIA
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_LOGIN_BASE_URL
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.http.LoginApiRequestUtil
......@@ -28,8 +29,8 @@ class LoginModelImpl : ILoginContract.Model {
/**
* 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定
*/
override fun checkPhoneStatus(phone: String, countryCode: String): Observable<BaseResponse<ChcekPhoneResponeBean>> {
return LoginApiRequestUtil.checkPhoneStatus(phone, countryCode)
override fun checkPhoneStatus(phone: String, countryCode: String,gatewayUrl :String): Observable<BaseResponse<ChcekPhoneResponeBean>> {
return LoginApiRequestUtil.checkPhoneStatus(phone, countryCode,gatewayUrl)
}
}
\ No newline at end of file
......@@ -49,8 +49,8 @@ class VerificationCodeModelImpl : IVerificationCodeContract.Model {
/**
* 发送登录验证码
*/
override fun sendLoginMsgCode(phone: String, countryCode: String): Observable<BaseResponse<Any>> {
return LoginApiRequestUtil.sendLoginMsgCode(phone, countryCode)
override fun sendLoginMsgCode(phone: String, countryCode: String,gatewayUrl:String): Observable<BaseResponse<Any>> {
return LoginApiRequestUtil.sendLoginMsgCode(phone, countryCode,gatewayUrl)
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.presenter
import android.annotation.SuppressLint
import android.text.TextUtils
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.StringUtils
......@@ -89,7 +90,7 @@ class InputPassWordPresenterImpl :
phoneCountryCode: String
) {
var param = PhoneLoginPwdParam(StringUtils.md5(inputPassword), phoneCountryCode, phone)
var param = PhoneLoginPwdParam(StringUtils.md5(inputPassword), phoneCountryCode, phone,HttpConfig.Companion.GET_GATEWAY_BASE_URL)
mModel.userLoginByPassword(param)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
......
......@@ -49,15 +49,19 @@ class LoginPresenterImpl(view: ILoginContract.View) :
}
/**
* 校验手机号:是否是用户版号码、是否有设置密码、是否被绑定
*@param isBind 是否是第三方登录成功后的绑定操作
*/
@SuppressLint("CheckResult")
override fun checkPhoneStatus(phone: String, countryCode: String, isBind: Boolean) {
override fun checkPhoneStatus(
phone: String,
countryCode: String,
isBind: Boolean,
gatewayUrl: String
) {
mView.showLoading(true)
mModel.checkPhoneStatus(phone, countryCode)
mModel.checkPhoneStatus(phone, countryCode, gatewayUrl)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
......
......@@ -2,6 +2,7 @@ package com.yidianling.user.ui.login.presenter
import android.annotation.SuppressLint
import android.text.TextUtils
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.utils.YDLCacheUtils
......@@ -35,7 +36,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
//发送登录验证码
@SuppressLint("CheckResult")
override fun sendLoginCode(phone: String, phoneCountryCode: String) {
mModel.sendLoginMsgCode(phone, phoneCountryCode)
mModel.sendLoginMsgCode(phone, phoneCountryCode,HttpConfig.Companion.GET_GATEWAY_BASE_URL)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { mView.showLoading(true) }
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="22dp"/>
<gradient
android:angle="180"
android:startColor="@color/platform_main_gradient_start_color"
android:endColor="@color/platform_main_gradient_end_color"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="22dp"/>
<gradient
android:angle="180"
android:startColor="@color/platform_main_gradient_start_color_un"
android:endColor="@color/platform_main_gradient_end_color_un"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
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