Commit ee99bd53 by konghaorui

升级组件版本号

parent 0b17daf5
......@@ -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);
}
}
......@@ -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)
}
......
......@@ -64,7 +64,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.28",
"ydl-platform" : "0.0.28.1",
//第二步 若干
"ydl-webview" : "0.0.28",
......
......@@ -219,9 +219,10 @@ 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 ("POST"==request.method()){
val body = request.body()
if (body is FormBody) {
(0 until body.size()).mapTo(destination = params) {
Param(
......@@ -243,6 +244,13 @@ class HttpConfig {
}
}
}
} 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 ->
val res = o1.name.compareTo(o2.name)
......@@ -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
)}"
}
......
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