Commit a28731b7 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

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