JaycePC месяцев назад: 9
Родитель
Сommit
08784e1b6d

+ 2 - 6
HttpCoreLibrary/src/main/java/com/rc/httpcore/HttpConfig.kt

@@ -4,12 +4,8 @@ class HttpConfig {
 
     companion object {
         //        var API_BASE_URL = "http://lab.zjznai.com/nwsuaf/api/"  //公网域名
-//        var API_BASE_URL = "http://192.168.1.43/api/"
-        var API_BASE_URL = "http://192.168.1.8/api/"
-//        var API_BASE_URL = "http://172.16.0.65/api/"
-//        var API_BASE_IMG_URL = "http://192.168.1.43/api"  //图片资源
-        var API_BASE_IMG_URL = "http://192.168.1.8/api"  //图片资源
-//        var API_BASE_IMG_URL = "http://172.16.0.65/api/"  //图片资源
+        var API_BASE_URL = "http://172.16.0.65/api/"
+        var API_BASE_IMG_URL = "http://172.16.0.65/api/"  //图片资源
 
         var API_BASE_QC_URL = "http://lab.zjznai.com/labTest"  //二维码地址  用于打印出的二维码路径跳转到小程序
 //        http://lab.zjznai.com/labAppTest?code=1760903781269671937&type=1   MSDS 路径生成

+ 8 - 12
HttpCoreLibrary/src/main/java/com/rc/httpcore/client/ChemicalClient.kt

@@ -49,7 +49,7 @@ interface ChemicalClient {
 
     fun searchProducer(): Observable<List<SearchBean>>
 
-    fun searchSpec(specNum:String): Observable<SearchSpecBean>
+    fun searchSpec(specNum: String): Observable<SearchSpecBean>
 
     fun getSelects(searchValue: String): Observable<List<BelongingPersonBean>>
 
@@ -74,10 +74,12 @@ interface ChemicalClient {
     fun getStockWaitDetails(waitId: String): Observable<UnifiedVerBean>
 
     fun waitList(
-        mutableMap: Map<String, Any> ): Observable<PageHxpStockBean>
+        mutableMap: Map<String, Any>
+    ): Observable<PageHxpStockBean>
 
     fun getStockList(
-        mutableMap: Map<String, Any>): Observable<HxpStockWaitModeBean>
+        mutableMap: Map<String, Any>
+    ): Observable<HxpStockWaitModeBean>
 
     fun getByRfid(rfidCode: String): Observable<UseBean>
 
@@ -93,7 +95,7 @@ interface ChemicalClient {
 
     fun backDetail(rfidCode: String): Observable<ReturnDetailsBean>
 
-    fun chemicalSearchBean(rfidCode: String,subId:String): Observable<ChemicalSearchBean>
+    fun chemicalSearchBean(rfidCode: String, subId: String): Observable<ChemicalSearchBean>
 
     fun discardDetail(rfidCode: String): Observable<ReturnDetailsBean>
 
@@ -102,7 +104,8 @@ interface ChemicalClient {
     fun returnGiveBack(model: GiveBackBean): Observable<ReturnGiveBackBean>
 
     fun stockDetailsList(
-        mutableMap: Map<String, String>): Observable<WasteChemicalsBean>
+        mutableMap: Map<String, String>
+    ): Observable<WasteChemicalsBean>
 
     fun getCabinetLock(doorId: String): Observable<List<LockVoListBean>>
 
@@ -160,13 +163,6 @@ interface ChemicalClient {
     fun onepcApkUpdate(id: String, state: String): Observable<Boolean>
 
     /**
-     * 学习一体机 用户端登录
-     *
-     * @param param 刷学生卡数据 userName
-     */
-    fun learnLogin(param: LearnLoginReq): Observable<LearnLoginVo>
-
-    /**
      * 退出登录
      */
     fun loginOut(): Observable<Boolean>

+ 0 - 20
HttpCoreLibrary/src/main/java/com/rc/httpcore/client/retrofit/ChemicalRetrofit.kt

@@ -771,26 +771,6 @@ class ChemicalRetrofit : ChemicalClient {
             }
     }
 
-    /**
-     * 用户端登录
-     *
-     * @param param 刷学生卡数据 userName
-     */
-    override fun learnLogin(param: LearnLoginReq): Observable<LearnLoginVo> {
-        Log.d("param:===========", "" + param.machineCode)
-        Log.d("param:===========", "" + param.userName)
-        Log.d("param:===========", "" + param.type)
-        Log.d("param:===========", "" + param.aioType)
-        return apiService.learnLogin(param)
-            .map { response ->
-                if (!response.isSuccess()) {
-                    throw NetException(response.code, response.message)
-                }
-
-//                HttpClient.token = response.data?.access_token
-                return@map response.data
-            }
-    }
 
     /**
      * 退出登录

+ 1 - 1
HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/ParameterValidationInterceptor.kt

@@ -64,7 +64,7 @@ class ParameterValidationInterceptor : Interceptor {
 //            }
 //        }
         if (!AppUtils.isAppDebug()) {
-            LogUtils.d(request.toString())
+            LogUtils.json(request)
         }
         // 打印所有请求参数(合并为一行)
 //        Log.d(TAG, "Request body: $bodyParametersLog")

+ 3 - 1
HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/ResponseInterceptor.kt

@@ -1,15 +1,17 @@
 package com.rc.httpcore.interceptor
 
 import android.util.Log
+import com.blankj.utilcode.util.LogUtils
 import okhttp3.Interceptor
 import okhttp3.Response
 import java.io.IOException
 
 class ResponseInterceptor : Interceptor {
     override fun intercept(chain: Interceptor.Chain): Response {
-        Log.d("====ResponseInterceptor","拦截器")
+        Log.d("====ResponseInterceptor", "拦截器")
         val response = chain.proceed(chain.request())
         if (!response.isSuccessful || response.body() == null) {
+            LogUtils.json(response)
             throw IOException("Response failed or body is null")
         }
         return response

+ 5 - 2
HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/TokenHeaderInterceptor.kt

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
 import android.content.Intent
 import android.util.Log
 import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import com.blankj.utilcode.util.LogUtils
 import com.google.gson.Gson
 import com.rc.httpcore.HttpClient
 import com.rc.httpcore.vo.CommonResponse
@@ -22,7 +23,8 @@ class TokenHeaderInterceptor : Interceptor {
         val requestBuilder: Request.Builder = originalRequest.newBuilder()
         if (!HttpClient.token.isNullOrEmpty()) {
             requestBuilder.addHeader("authorization", HttpClient.token!!)
-            Log.d("===========",HttpClient.token!!)
+            Log.d("===========", HttpClient.token!!)
+            LogUtils.d("Token", HttpClient.token!!)
 //            requestBuilder.addHeader("authorization", "2cb6ac5a-33e7-404f-a3a7-145fc7420763")
         }
 
@@ -45,7 +47,8 @@ class TokenHeaderInterceptor : Interceptor {
                 source.request(Long.MAX_VALUE)
                 val data = source.buffer.clone().readString(StandardCharsets.UTF_8)
 
-                val commonResponse = Gson().fromJson<CommonResponse>(data, CommonResponse::class.java)
+                val commonResponse =
+                    Gson().fromJson<CommonResponse>(data, CommonResponse::class.java)
                 if (commonResponse.isTokenExpired()) {
                     HttpClient.getAppContext()?.apply {
                         val intent = Intent("com.rc.core.token_expired")

+ 0 - 3
app/build.gradle

@@ -95,8 +95,6 @@ dependencies {
     implementation dep.kotlinxCoroutinesAndroid
 
     implementation dep.androidMultidex
-    implementation dep.buglySDK
-    implementation dep.buglyNDK
     implementation dep.mqttv3
     implementation dep.eventbus
     implementation dep.bgaZxing
@@ -138,5 +136,4 @@ dependencies {
     implementation 'com.blankj:utilcodex:1.31.1'
 
 
-
 }

+ 0 - 1
app/src/main/AndroidManifest.xml

@@ -73,7 +73,6 @@
         android:theme="@style/Theme.AppFullTheme"
         android:usesCleartextTraffic="true"
         tools:targetApi="m">
-
         <meta-data
             android:name="ScopedStorage"
             android:value="true" />

+ 0 - 1
app/src/main/java/com/example/chemical/ChemicalApp.kt

@@ -16,7 +16,6 @@ import com.rc.core.util.ScreenAdapter
 import com.rc.httpcore.apk.LabInfo
 import com.rc.httpcore.bean.ConfigBean
 import com.rc.httpcore.bean.UserData
-import com.tencent.bugly.crashreport.CrashReport
 import com.tencent.smtt.export.external.TbsCoreSettings
 import com.tencent.smtt.sdk.QbSdk
 

+ 1 - 2
app/src/main/java/com/example/chemical/ui/SplashActivity.kt

@@ -185,8 +185,7 @@ class SplashActivity : RcBaseActivity<ActivitySplashBinding>() {
         //    AIO_CHEMICAL("aio_chemical","化学品一体机"),
         //    AIO_INFOBORD("aio_infobord","电子信息牌"),
         //    AIO_EXAM("aio_exam","学习考试一体机");
-        val disposable =
-            ApiRepository.getCheck(mDeviceNum!!, "aio_chemical", toDouble.toDouble())
+        val disposable = ApiRepository.getCheck(mDeviceNum!!, "aio_chemical", toDouble.toDouble())
                 .subscribe({ data ->
                     dismissLoading()
                     if (!data.needUpgrade) {

+ 0 - 2
app/src/main/java/com/example/chemical/ui/still/MsdsScreenActivity.kt

@@ -47,8 +47,6 @@ class MsdsScreenActivity : RcBaseActivity<ActivityMsdsScreenBinding>() {
             )
         )
 
-//        var b="http://192.168.1.8/#/androidFilePreview"
-//        val param1 = "http://192.168.1.8/api//statics/bigFile/20240524/5b996331-3974-477c-b795-ba730999a382.docx"
 //        val encodedParam1 = URLEncoder.encode(param1, "UTF-8")
 //        val urlWithParams = "$b?url=$encodedParam1"
 //        RcLog.info("fileBrowsers_s:${urlWithParams}")

+ 2 - 2
app/src/main/res/layout/activity_setting.xml

@@ -59,7 +59,7 @@
             android:layout_alignParentRight="true"
             android:background="@null"
             android:maxLines="1"
-            android:text="http://192.168.1.8/api/" />
+            android:text="http://172.16.0.65/api/" />
 
     </RelativeLayout>
 
@@ -82,7 +82,7 @@
             android:layout_alignParentRight="true"
             android:background="@null"
             android:maxLines="1"
-            android:text="http://192.168.1.8/api" />
+            android:text="http://172.16.0.65/api" />
 
     </RelativeLayout>
 

+ 1 - 3
config/config.gradle

@@ -10,7 +10,7 @@ ext {
             targetSdkVersion : 28,
             applicationId    : "com.zhong.che",
             versionCode      : 20,
-            versionName      : "1.20"
+            versionName      : "1.24"
     ]
 
     test = [
@@ -48,8 +48,6 @@ ext {
             eventbus                     : 'org.greenrobot:eventbus:3.2.0',
             rxpermissions                : 'com.github.tbruyelle:rxpermissions:0.11',
             glide                        : 'com.github.bumptech.glide:glide:4.11.0',
-            buglySDK                     : 'com.tencent.bugly:crashreport:3.4.4',
-            buglyNDK                     : 'com.tencent.bugly:nativecrashreport:3.9.2',
             mqttv3                       : 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0',
             bgaZxing                     : 'com.github.bingoogolapple.BGAQRCode-Android:zxing:1.3.8',
             runtimektx                   : 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0',