Explorar el Código

Merge branch 'feature/1.2.13' into develop

Zhenghanjv hace 2 semanas
padre
commit
747ccfda2c

+ 2 - 2
app/build.gradle

@@ -21,8 +21,8 @@ android {
         applicationId "com.doverfuelingsolutions.issp"
         minSdkVersion 22
         targetSdkVersion 26
-        versionCode 25
-        versionName "1.2.12"
+        versionCode 27
+        versionName "1.2.14"
         archivesBaseName = versionName + "." + getTime()
 
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

+ 3 - 0
app/src/main/java/com/doverfuelingsolutions/issp/api/SystemApi.kt

@@ -297,6 +297,9 @@ object SystemApi {
                     codeResponse == 406 -> {
                         it.resume(DFSResult.fail("优惠券核销不通过"))
                     }
+                    codeResponse == 410 -> {
+                        it.resume(DFSResult.fail("订单支付中"))
+                    }
                     else -> {
                         it.resume(DFSResult.fail(R.string.fail_pay))
                     }

+ 1 - 1
app/src/main/java/com/doverfuelingsolutions/issp/view/LoginActivity.kt

@@ -108,7 +108,7 @@ class LoginActivity : AppCompatActivity(),
             val password = loginViewModel.password.value
             when {
                 accountName.isNullOrBlank() || password.isNullOrBlank() -> snackbar.setText(R.string.input_not_right).show()
-                !isRightAccountAndDevice(accountName) -> snackbar.setText(R.string.error_account_device).show()
+//                !isRightAccountAndDevice(accountName) -> snackbar.setText(R.string.error_account_device).show()
                 else -> {
                     val result = SystemApi.login(accountName, password)
                     if (!result.success) snackbar.setText(StringUtil.get(R.string.login_fail_reason, result.message)).show()

+ 7 - 7
app/src/main/java/com/doverfuelingsolutions/issp/view/util/LoginTokenRefresher.kt

@@ -24,13 +24,13 @@ class LoginTokenRefresher {
             val delayTime = expireMoment - 480_000 - System.currentTimeMillis()
             if (delayTime > 0) delay(delayTime)
 
-            val userDevice = SystemApi.getUserDevice(GlobalData.accountName.get(), GlobalData.serialNumber.get())
-            if (!userDevice.success || userDevice.data != true) {
-                DFSLog.d("loginToken refresh 账户与设备不符合")
-                val msg = StringUtil.get(R.string.error_account_device)
-                toLogin(msg,activity)
-                return@launch
-            }
+//            val userDevice = SystemApi.getUserDevice(GlobalData.accountName.get(), GlobalData.serialNumber.get())
+//            if (!userDevice.success || userDevice.data != true) {
+//                DFSLog.d("loginToken refresh 账户与设备不符合")
+//                val msg = StringUtil.get(R.string.error_account_device)
+//                toLogin(msg,activity)
+//                return@launch
+//            }
 
             val result = SystemApi.login(GlobalData.accountName.get(), GlobalData.password.get())
             if (result.success) {