Commit 4c78958e by hgw

ydl-platform中增加获取公用参数方法

parent 9af61216
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
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment