Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
android-koreadc-client-aar
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑鹏
android-koreadc-client-aar
Commits
7954c2bf
Commit
7954c2bf
authored
Jan 17, 2021
by
郑鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加调试
parent
eb2094f5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
18 deletions
+21
-18
app-debug.apk
app/debug/app-debug.apk
+0
-0
build.gradle
baselib/build.gradle
+2
-0
BaseApi.java
baselib/src/main/java/cn/dankal/basiclib/api/BaseApi.java
+19
-18
No files found.
app/debug/app-debug.apk
View file @
7954c2bf
No preview for this file type
baselib/build.gradle
View file @
7954c2bf
...
...
@@ -119,6 +119,8 @@ dependencies {
api
'com.qq.mta:mta:3.4.7-Release'
api
'com.tencent.mid:mid:4.06-Release'
api
'com.github.liys666666:DoubleClick:V2.0.4'
api
'com.readystatesoftware.chuck:library:1.1.0'
//添加
api
project
(
':refresh-layout'
)
}
baselib/src/main/java/cn/dankal/basiclib/api/BaseApi.java
View file @
7954c2bf
...
...
@@ -3,12 +3,15 @@ package cn.dankal.basiclib.api;
import
android.util.Log
;
import
com.facebook.stetho.okhttp3.StethoInterceptor
;
import
com.readystatesoftware.chuck.ChuckInterceptor
;
import
java.util.concurrent.TimeUnit
;
import
javax.net.ssl.HostnameVerifier
;
import
javax.net.ssl.SSLSession
;
import
cn.dankal.basiclib.BuildConfig
;
import
cn.dankal.basiclib.DankalApplication
;
import
cn.dankal.basiclib.domain.HttpLoggingInterceptor
;
import
cn.dankal.basiclib.domain.TokenInterceptor
;
import
okhttp3.OkHttpClient
;
...
...
@@ -24,8 +27,10 @@ import static cn.dankal.basiclib.DankalApplication.isDev;
*/
public
class
BaseApi
{
public
static
final
String
BASE_URL
=
isDev
?
"https://api-koreadc.dankal.cn/v1/"
:
"https://modoo-api.mhqglobal.com/v1/"
;
/*public static final String BASE_URL = isDev ? "https://api-koreadc.dankal.cn/v1/"
: "https://modoo-api.mhqglobal.com/v1/";*/
public
static
final
String
BASE_URL
=
"https://modoo-api.mhqglobal.com/v1/"
;
public
static
final
String
BASE_EXPRESS_URL
=
"https://info.sweettracker.co.kr/"
;
...
...
@@ -76,29 +81,25 @@ public class BaseApi {
}
});
httpLoggingInterceptor
.
setLevel
(
HttpLoggingInterceptor
.
Level
.
BODY
);
OkHttpClient
okHttpClient
;
if
(
BuildConfig
.
DEBUG
)
{
okHttpClient
=
new
OkHttpClient
.
Builder
().
readTimeout
(
18000
,
TimeUnit
.
MILLISECONDS
)
.
connectTimeout
(
18000
,
TimeUnit
.
MILLISECONDS
)
.
addInterceptor
(
httpLoggingInterceptor
)
.
addInterceptor
(
new
TokenInterceptor
())
.
addNetworkInterceptor
(
new
StethoInterceptor
())
.
hostnameVerifier
(
new
HostnameVerifier
()
{
/**
* Verify that the host name is an acceptable match with
* the server's authentication scheme.
*
* @param hostname the host name
* @param session SSLSession used on the connection to host
* @return true if the host name is acceptable
*/
//忽略证书
@Override
public
boolean
verify
(
String
hostname
,
SSLSession
session
)
{
return
true
;
}
})
.
addInterceptor
(
new
ChuckInterceptor
(
DankalApplication
.
getContext
()))
.
build
();
}
else
{
okHttpClient
=
new
OkHttpClient
.
Builder
().
readTimeout
(
18000
,
TimeUnit
.
MILLISECONDS
)
.
connectTimeout
(
18000
,
TimeUnit
.
MILLISECONDS
)
.
addInterceptor
(
httpLoggingInterceptor
)
.
addInterceptor
(
new
TokenInterceptor
())
.
addNetworkInterceptor
(
new
StethoInterceptor
())
.
build
();
}
return
okHttpClient
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment