|
|
@@ -10,6 +10,11 @@ import cn.zhxu.okhttps.gson.GsonMsgConvertor
|
|
|
import cn.zhxu.okhttps.okhttp.OkHttpClientWrapper
|
|
|
import com.grkj.iscs.MyApplication
|
|
|
import com.grkj.iscs.R
|
|
|
+import com.grkj.iscs.model.Constants.DEVICE_TYPE
|
|
|
+import com.grkj.iscs.model.Constants.DEVICE_TYPE_HYBRID
|
|
|
+import com.grkj.iscs.model.Constants.DEVICE_TYPE_MATERIAL
|
|
|
+import com.grkj.iscs.model.Constants.DEVICE_TYPE_NORMAL
|
|
|
+import com.grkj.iscs.model.Constants.DEVICE_TYPE_PORTABLE
|
|
|
import com.grkj.iscs.model.Token
|
|
|
import com.grkj.iscs.model.UrlConsts
|
|
|
import com.grkj.iscs.model.UrlConsts.LOGIN_CARD
|
|
|
@@ -57,6 +62,12 @@ class NetHttpManager {
|
|
|
it.addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
|
|
|
}
|
|
|
.addSerialPreprocessor { itPreChain ->
|
|
|
+ itPreChain.task.addHeader("Module", when (DEVICE_TYPE) {
|
|
|
+ 2 -> DEVICE_TYPE_MATERIAL
|
|
|
+ 3 -> DEVICE_TYPE_PORTABLE
|
|
|
+ 4 -> DEVICE_TYPE_HYBRID
|
|
|
+ else -> DEVICE_TYPE_NORMAL
|
|
|
+ })
|
|
|
if (!itPreChain.task.isTagged(tagAuth)) {
|
|
|
itPreChain.proceed()
|
|
|
return@addSerialPreprocessor
|