2 Commits 2d8fb8453a ... a5bded5c55

Auteur SHA1 Bericht Datum
  Administrator a5bded5c55 shuhao 2 jaren geleden
  Administrator b0dceabf7f 新增访问接口请求头currentTime 2 jaren geleden

+ 5 - 0
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/com/zedu/cocos/congming/app/organ/OrganClientZedu.java

@@ -5,6 +5,8 @@ import com.lzy.okgo.model.HttpParams;
 import com.lzy.okgo.model.Response;
 import com.zedu.cocos.congming.app.device.DeviceClient;
 import com.zedu.cocos.congming.app.device.DeviceClientZedu;
+import com.zedu.cocos.congming.app.time.TimeClient;
+import com.zedu.cocos.congming.app.time.TimeClientZedu;
 import com.zedu.core.global.ErrorEvent;
 import com.zedu.support.request.OkgoClient;
 import com.zedu.support.request.OkgoTask;
@@ -31,6 +33,8 @@ public class OrganClientZedu extends OkgoTask implements OrganClient {
     DeviceClient mDeviceClient;
     @Pref
     OrganPrefs_ mOrganPrefs;
+    @Bean(TimeClientZedu.class)
+    TimeClient mTimeClient;
 
     @Override
     public void login(String key, String androidId) {
@@ -48,6 +52,7 @@ public class OrganClientZedu extends OkgoTask implements OrganClient {
                 if (code == ResponseCode.RES_SUCCESS) {
                     if (result.data != null) {
                         mBus.post(new OrganEvent(result.data));
+                        mTimeClient.updateLastTime();
                         mDeviceClient.register(result.data.organKey);
                     }
                 } else if (code == ResponseCode.RES_Try) {

+ 1 - 1
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/com/zedu/cocos/congming/app/request/OkgoApi.java

@@ -6,7 +6,7 @@ package com.zedu.cocos.congming.app.request;
 public class OkgoApi {
 
     public static final String HOST = "api.zhi-edu.com";
-    //  public static final String HOST = "192.168.0.120";
+      //public static final String HOST = "dev.zhi-edu.com";
 
     // ============公共
 

+ 1 - 0
build/jsb-link/frameworks/runtime-src/proj.android-studio/lib_core/src/main/java/com/zedu/support/request/OkgoClientCache.java

@@ -104,6 +104,7 @@ public class OkgoClientCache {
         String key = MD5Coder.getMD5Code(url + "?" + SignParams.getSortParams(params));
         // 构造请求
         OkGo.<T>post(url)// 地址
+                .headers("currentTime",Long.toString(System.currentTimeMillis()))
                 .params(params)// 参数
                 .cacheKey(StringUtils.isEmpty(cacheKey) ? key : cacheKey)// 缓存key
                 .cacheMode(cacheMode) // 缓存模式