| | |
| | | import okhttp3.Response; |
| | | import okhttp3.ResponseBody; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class ARDCarGPSLogInClient { |
| | | |
| | | public static Map<String,Object> loginIn(String syURL,String userId,String password){ |
| | | public static Map<String, Object> loginIn(String syURL, String userId, String password) { |
| | | OkHttpClient okHttpClient = new OkHttpClient(); |
| | | |
| | | String passwordMd5 = DigestUtils.md5Hex(password); |
| | |
| | | .url("http://116.182.15.14:9999/gps-web/api/login.jsp?"+"password="+passwordMd5+"&userId="+userId+"&loginType=user&loginWay=interface&loginLang=zh_CN") |
| | | .build();*/ |
| | | Request request = new Request.Builder() |
| | | .url(syURL + "/gps-web/api/login.jsp?"+"password="+passwordMd5+"&userId="+userId+"&loginType=user&loginWay=interface&loginLang=zh_CN") |
| | | .url(syURL + "/gps-web/api/login.jsp?" + "password=" + passwordMd5 + "&userId=" + userId + "&loginType=user&loginWay=interface&loginLang=zh_CN") |
| | | .build(); |
| | | Response response = null; |
| | | try { |
| | |
| | | |
| | | try { |
| | | String message = responseBody.string();// 响应体 |
| | | Map<String,Object> map = (Map<String, Object>) JSON.parse(message); |
| | | Map<String, Object> map = (Map<String, Object>) JSON.parse(message); |
| | | map.put("passwordMd5", passwordMd5); |
| | | //System.out.println(message); |
| | | return map; |