Browse Source

优化代码,修改包名

yanyi 5 years ago
parent
commit
983c5a53ca

+ 0 - 0
gradlew


+ 3 - 3
okhttplib/bintrayUpload.gradle

@@ -3,11 +3,11 @@ apply plugin: 'com.github.dcendents.android-maven'
 apply plugin: 'com.jfrog.bintray'
 
 // 定义两个链接,下面会用到。
-def siteUrl = 'https://github.com/BenYanYi/OkHttp' // 项目主页。
-def gitUrl = 'https://github.com/BenYanYi/OkHttp.git' // Git仓库的url。
+def siteUrl = 'http://www.yanyis.space/yanyi/baseokhttp' // 项目主页。
+def gitUrl = 'http://www.yanyis.space/yanyi/baseokhttp.git' // Git仓库的url。
 
 group = "com.yanyi.benyanyi"// 唯一包名,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的com.ansen.http就是这里配置的。
-version = "1.1.2" //项目引用的版本号,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的1.0.1就是这里配置的。
+version = "1.1.3" //项目引用的版本号,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的1.0.1就是这里配置的。
 install {
     repositories.mavenInstaller {
         // This generates POM.xml with proper parameters

+ 4 - 2
okhttplib/src/main/java/com/benyanyi/okhttp/CacheInterceptor.java

@@ -1,5 +1,7 @@
 package com.benyanyi.okhttp;
 
+import android.support.annotation.NonNull;
+
 import java.io.IOException;
 
 import okhttp3.Interceptor;
@@ -11,15 +13,15 @@ import okhttp3.Response;
  */
 
  class CacheInterceptor implements Interceptor {
+    @NonNull
     @Override
     public Response intercept(Chain chain) throws IOException {
         Request request = chain.request();
         Response response = chain.proceed(request);
-        Response build = response.newBuilder()
+        return response.newBuilder()
                 .removeHeader("Pragma")
                 .removeHeader("GlideCache-Control")
                 .header("GlideCache-Control", "max-age=" + 60)
                 .build();
-        return build;
     }
 }