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
4c78958e
Commit
4c78958e
authored
Nov 12, 2019
by
hgw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ydl-platform中增加获取公用参数方法
parent
9af61216
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
gradle.properties
ydl-platform/gradle.properties
+2
-2
AppUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/AppUtils.kt
+36
-0
No files found.
ydl-platform/gradle.properties
View file @
4c78958e
IS_PUBLISH
=
true
VERSION_NAME
=
0.0.13
\ No newline at end of file
VERSION_NAME
=
0.0.14
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/AppUtils.kt
View file @
4c78958e
...
...
@@ -2,6 +2,16 @@ package com.ydl.ydlcommon.utils
import
android.app.ActivityManager
import
android.content.Context
import
com.ydl.ydlcommon.BuildConfig
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.config.YDLConstants
import
com.ydl.ydlcommon.base.config.YDLConstants.ENV_TEST
import
com.ydl.ydlcommon.data.PlatformDataManager
import
com.ydl.ydlcommon.data.http.YdlCommonApi
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.router.YdlCommonOut
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxDeviceTool
/**
* Created by haorui on 2019/4/25.
...
...
@@ -27,4 +37,29 @@ object AppUtils {
return
isRunning
}
/**
* 获取http请求公用参数
*
*/
fun
getHttpCommonParams
():
Map
<
String
,
Any
>{
val
mMap
=
mutableMapOf
<
String
,
Any
>()
val
appEnv
=
BaseApp
.
instance
.
getGlobalConfig
().
appEnv
val
isTest
=
ENV_TEST
==
appEnv
val
osBuild
=
"${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()},${RxAppTool.getAppVersionName(
BaseApp
.
getApp
()
)}
"
val
loginBean
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
mMap
[
"isDevelopment"
]
=
isTest
mMap
[
"uid"
]
=
loginBean
?.
userId
?:
""
mMap
[
"accessToken"
]
=
loginBean
?.
token
?:
""
mMap
[
"isFromApp"
]
=
"1"
mMap
[
"version"
]
=
RxAppTool
.
getAppVersionName
(
BaseApp
.
getApp
())
mMap
[
"osBuild"
]
=
osBuild
mMap
[
"ffrom"
]
=
PlatformDataManager
.
getRam
().
getChannelName
()
mMap
[
"osType"
]
=
"android"
return
mMap
}
}
\ No newline at end of file
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