Commit a28731b7 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent f3ad3ad3
......@@ -23,7 +23,7 @@ interface MainApi {
* @return
*/
@POST("na/saveTerminalInfo")
fun comSaveTerminalInfo(@Body vo: Map<String, Any>): Observable<Response<BaseResponse<Any>>>
fun comSaveTerminalInfo(@Body vo: @JvmSuppressWildcards Map<String, Any>): Observable<Response<BaseResponse<Any>>>
/**
* 获取验证码
......@@ -31,7 +31,7 @@ interface MainApi {
* @return
*/
@POST("api/sendMobileCode")
fun sendMobileCode(@Body vo: Map<String, String>): Observable<Response<BaseResponse<Any>>>
fun sendMobileCode(@Body vo: @JvmSuppressWildcards Map<String, Any>): Observable<Response<BaseResponse<Any>>>
/**
* 登录
......
......@@ -47,9 +47,8 @@ class LoginActivity : BaseActivity<ActivityLoginBinding, LoginViewModel>(), View
return@setOnClickListener
}
if (!userManager.getMobile().isEmpty()) {
ToastUtils.showLong("验证码已发送")
sendCodeThread()
}
mobile = mobile.replace(" ".toRegex(), "")
viewModel.sendMobileCode(mobile)
......
......@@ -33,7 +33,7 @@ class LoginViewModel(application: Application) : BaseViewModel(application) {
* @param mobile
*/
fun sendMobileCode(mobile: String) {
val vo = HashMap<String, String>()
val vo = HashMap<String, Any>()
vo["mobile"] = mobile
// vo["type"] = 1
......
......@@ -95,6 +95,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
private fun uploadDeviceInfo() {
UmengManager.initUm()
viewModel.comSaveTerminalInfo()
}
override fun initData() {
......
......@@ -24,7 +24,7 @@ object ApiModel {
/**
* 发送验证码
*/
fun sendMobileCode(lifecycleProvider: LifecycleProvider<Any>?, map: Map<String, String>): Observable<Response<BaseResponse<Any>>> {
fun sendMobileCode(lifecycleProvider: LifecycleProvider<Any>?, map: Map<String, Any>): Observable<Response<BaseResponse<Any>>> {
return HttpManager.getInstance()
.execute(lifecycleProvider, MainApi.newInstance().sendMobileCode(map))
}
......
......@@ -121,13 +121,6 @@
android:src="@mipmap/pay_unselect" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#979797" />
<LinearLayout
android:id="@+id/ly_alipay"
android:layout_width="match_parent"
......
......@@ -14,9 +14,10 @@
android:layout_height="130dp">
<LinearLayout
android:layout_width="80dp"
android:layout_height="130dp"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
......
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