疯体ios登陆修改5

master
duhui 2022-07-13 11:57:52 +08:00
parent 318556bc28
commit dc449cbaca
2 changed files with 10 additions and 9 deletions

View File

@ -148,15 +148,15 @@ public class QuickVerifyService3 extends AbstractVerifyService {
boolean doVerifyIos(VerifyParams params, String url) {
LOGGER.info("疯体 Ohayoo 登录验证-->{}",params.getOpenId());
HashMap<String, String> map = new HashMap<>();
map.put("token",params.getToken());
map.put("product_code",params.getProductCode());
map.put("uid",params.getOpenId());
JSONObject json = new JSONObject();
json.put("token",params.getToken());
json.put("product_code",params.getProductCode());
json.put("uid",params.getOpenId());
boolean result = false;
String r = null;
try {
r = HttpUtils.doPost2(url, map);
r = HttpUtils.doPost2(url, json.toJSONString());
LOGGER.info("疯体 Ohayoo 请求结果:{}",r);
JSONObject resultJson = JSON.parseObject(r);
int status = resultJson.getIntValue("status");

View File

@ -6,6 +6,8 @@ import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.client.HttpClients;
@ -38,12 +40,11 @@ public class HttpUtils {
}
}
public static String doPost2(String url, Map<String,String> parms) throws IOException {
public static String doPost2(String url, String json) throws IOException {
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(url);
List<NameValuePair> nvps = getFromMap(parms);
httpPost.setEntity(new UrlEncodedFormEntity(nvps));
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
StringEntity stringEntity = new StringEntity(json, ContentType.APPLICATION_FORM_URLENCODED);
httpPost.setEntity(stringEntity);
CloseableHttpResponse response2 = httpclient.execute(httpPost);
try {