|
@@ -1,5 +1,6 @@
|
|
|
package com.zanxiang.game.module.sdk.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
@@ -110,6 +111,11 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
}
|
|
|
|
|
|
private Map<String, String> channelTransform(String channel) {
|
|
|
+ //判断是否是json, 是就直接转成map
|
|
|
+ if (this.isJsonStr(channel)) {
|
|
|
+ return JsonUtil.toMap(channel, Map.class, String.class);
|
|
|
+ }
|
|
|
+ //非json, 自己解析
|
|
|
Map<String, String> paramMap = new HashMap<>(11);
|
|
|
String[] params = channel.split("&");
|
|
|
for (String param : params) {
|
|
@@ -122,4 +128,14 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
}
|
|
|
return paramMap;
|
|
|
}
|
|
|
+
|
|
|
+ private boolean isJsonStr(String str) {
|
|
|
+ boolean result = false;
|
|
|
+ try {
|
|
|
+ JSON.parse(str);
|
|
|
+ result = true;
|
|
|
+ } catch (Exception ignored) {
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|