|
@@ -26,10 +26,15 @@ public class BdUtil {
|
|
|
public String login(){
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
params.put("account", bdProperties.getAccount());
|
|
|
- params.put("pass", DigestUtils.md5DigestAsHex(bdProperties.getPass().getBytes()));
|
|
|
+ String pass = bdProperties.getPass();
|
|
|
+ if(bdProperties.isEncode()){
|
|
|
+ pass = DigestUtils.md5DigestAsHex(bdProperties.getPass().getBytes());
|
|
|
+ }
|
|
|
+ params.put("pass", pass);
|
|
|
String url = bdProperties.getAddress() + bdProperties.getLogin();
|
|
|
JSONObject jsonObject = httpClient.postJson(url, params);
|
|
|
- String token = jsonObject.getString("token");
|
|
|
+ JSONObject data = jsonObject.getJSONObject("data");
|
|
|
+ String token = data.getString("token");
|
|
|
if(StrUtil.isEmpty(token)){
|
|
|
throw new RuntimeException("登录失败");
|
|
|
}
|
|
@@ -99,7 +104,7 @@ public class BdUtil {
|
|
|
params.put("id,", id);
|
|
|
params.put("thirdFlag", thirdFlag);
|
|
|
params.put("operateResult", operateResult);
|
|
|
- String url = bdProperties.getAddress() + bdProperties.getSearchDataFerryInner();
|
|
|
+ String url = bdProperties.getAddress() + bdProperties.getUpdateDataFerryInner();
|
|
|
JSONObject upload = httpClient.postJson(url, headers, params);
|
|
|
}
|
|
|
|