Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
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
杨凯
YDL-Component-Medical
Commits
ee99bd53
Commit
ee99bd53
authored
Nov 27, 2019
by
konghaorui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级组件版本号
parent
0b17daf5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
22 deletions
+36
-22
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+4
-1
DemoPresenter.kt
app/src/main/java/com/ydl/component/mvp/DemoPresenter.kt
+4
-0
config.gradle
config.gradle
+1
-1
HttpConfig.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
+27
-20
No files found.
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
ee99bd53
...
...
@@ -25,9 +25,12 @@ public final class DemoGlobalConfig implements IConfigModule {
@Override
public
void
applyOptions
(
@NotNull
Context
context
,
@NotNull
GlobalConfig
.
Builder
builder
)
{
String
env
=
YDLConstants
.
ENV_AUTO_TEST
;
// String env = YDLConstants.ENV_PROD;
builder
.
setFrom
(
"ydl"
.
equals
(
BuildConfig
.
FLAVOR
)
?
YDLConstants
.
FROM_YDL
:
YDLConstants
.
FROM_XLZX
)
.
addUrl
(
"github"
,
APP_DOMAIN
)
.
setEnv
(
YDLConstants
.
ENV_PROD
)
.
setEnv
(
env
)
.
setDebug
(
BuildConfig
.
DEBUG
);
}
}
app/src/main/java/com/ydl/component/mvp/DemoPresenter.kt
View file @
ee99bd53
...
...
@@ -39,6 +39,10 @@ class DemoPresenter : BasePresenter<DemoContract.View,DemoContract.Model>(),
}
override
fun
onSuccess
(
users
:
JsonObject
)
{
if
(
users
.
getAsJsonObject
(
"data"
)==
null
){
mView
.
setData
(
""
)
return
}
var
cateTitle
=
users
.
getAsJsonObject
(
"data"
).
getAsJsonArray
(
"askCategoryData"
).
get
(
0
).
asJsonObject
.
get
(
"cateTitle"
).
asString
;
mView
.
setData
(
cateTitle
)
}
...
...
config.gradle
View file @
ee99bd53
...
...
@@ -64,7 +64,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.28"
,
"ydl-platform"
:
"0.0.28
.1
"
,
//第二步 若干
"ydl-webview"
:
"0.0.28"
,
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
View file @
ee99bd53
...
...
@@ -219,29 +219,37 @@ class HttpConfig {
private
fun
requestHead
(
appFrom
:
String
):
Interceptor
{
return
Interceptor
{
val
request
=
it
.
request
()
val
body
=
request
.
body
()
val
paramsString
=
StringBuilder
()
val
params
=
ArrayList
<
Param
>()
if
(
body
is
FormBody
)
{
(
0
until
body
.
size
()).
mapTo
(
destination
=
params
)
{
Param
(
body
.
name
(
it
),
body
.
value
(
it
)
)
}
if
(
"POST"
==
request
.
method
()){
val
body
=
request
.
body
()
if
(
body
is
FormBody
)
{
(
0
until
body
.
size
()).
mapTo
(
destination
=
params
)
{
Param
(
body
.
name
(
it
),
body
.
value
(
it
)
)
}
}
else
if
(
body
is
MultipartBody
)
{
for
(
part
in
body
.
parts
())
{
if
(
"text/plain; charset=utf-8"
==
part
.
body
().
contentType
()
!!
.
toString
())
{
val
headerStr
=
part
.
headers
()
!!
.
toString
()
val
name
=
headerStr
.
split
(
"\"\\n"
.
toRegex
()).
dropLastWhile
{
it
.
isEmpty
()
}.
toTypedArray
()[
0
].
split
(
"=\""
.
toRegex
()).
dropLastWhile
{
it
.
isEmpty
()
}.
toTypedArray
()[
1
]
val
buffer
=
Buffer
()
part
.
body
().
writeTo
(
buffer
as
BufferedSink
)
val
value
=
buffer
.
readUtf8
()
params
.
add
(
Param
(
name
,
value
))
}
else
if
(
body
is
MultipartBody
)
{
for
(
part
in
body
.
parts
())
{
if
(
"text/plain; charset=utf-8"
==
part
.
body
().
contentType
()
!!
.
toString
())
{
val
headerStr
=
part
.
headers
()
!!
.
toString
()
val
name
=
headerStr
.
split
(
"\"\\n"
.
toRegex
()).
dropLastWhile
{
it
.
isEmpty
()
}.
toTypedArray
()[
0
].
split
(
"=\""
.
toRegex
()).
dropLastWhile
{
it
.
isEmpty
()
}.
toTypedArray
()[
1
]
val
buffer
=
Buffer
()
part
.
body
().
writeTo
(
buffer
as
BufferedSink
)
val
value
=
buffer
.
readUtf8
()
params
.
add
(
Param
(
name
,
value
))
}
}
}
}
else
if
(
"GET"
==
request
.
method
()){
val
url
=
request
.
url
()
val
queryParameterNames
=
url
.
queryParameterNames
()
queryParameterNames
.
forEach
{
string
->
params
.
add
(
Param
(
string
,
url
.
queryParameter
(
string
)
?:
""
))
}
}
params
.
sortWith
(
Comparator
{
o1
,
o2
->
...
...
@@ -286,9 +294,8 @@ class HttpConfig {
}
private
fun
getOldAuth
(
paramsString
:
StringBuilder
):
String
{
paramsString
.
append
(
SESSION_KEY
)
return
"$YDL ${EncryptUtils.encryptMD5ToString(
paramsString
.
toString
()
paramsString
.
toString
()
+
SESSION_KEY
)}
"
}
...
...
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