generated from root/miduo_server
疯体ios登陆修改3
parent
68cdc31e62
commit
178af21e33
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||||
import com.ljsd.pojo.VerifyParams;
|
import com.ljsd.pojo.VerifyParams;
|
||||||
import com.ljsd.util.AppConstans;
|
import com.ljsd.util.AppConstans;
|
||||||
import com.ljsd.util.HttpUtils;
|
import com.ljsd.util.HttpUtils;
|
||||||
|
import com.ljsd.util.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
@ -146,23 +147,27 @@ public class QuickVerifyService3 extends AbstractVerifyService {
|
||||||
|
|
||||||
boolean doVerifyIos(VerifyParams params, String url) {
|
boolean doVerifyIos(VerifyParams params, String url) {
|
||||||
LOGGER.info("疯体 Ohayoo 登录验证-->{}",params.getOpenId());
|
LOGGER.info("疯体 Ohayoo 登录验证-->{}",params.getOpenId());
|
||||||
Map<String,String> parms = new HashMap<>();
|
|
||||||
parms.put("app_id",params.getProductCode());
|
JSONObject jsonObject = new JSONObject();
|
||||||
parms.put("token",params.getToken());
|
jsonObject.put("token",params.getToken());
|
||||||
parms.put("open_id",params.getOpenId());
|
jsonObject.put("product_code",params.getProductCode());
|
||||||
|
jsonObject.put("uid",params.getOpenId());
|
||||||
|
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
try {
|
String r = HttpUtils.sendPost(url, jsonObject);
|
||||||
String r = HttpUtils.doPost(url, parms);
|
|
||||||
LOGGER.info("疯体 Ohayoo 请求结果:{}",r);
|
LOGGER.info("疯体 Ohayoo 请求结果:{}",r);
|
||||||
JSONObject jsonObject = JSON.parseObject(r);
|
|
||||||
int status = jsonObject.getIntValue("status");
|
if (StringUtils.checkIsEmpty(r)){
|
||||||
if(status == 0){
|
|
||||||
result = true;
|
|
||||||
}
|
|
||||||
}catch (IOException e){
|
|
||||||
LOGGER.info("疯体 Ohayoo 验证失败,IOException");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JSONObject resultJson = JSON.parseObject(r);
|
||||||
|
int status = resultJson.getIntValue("status");
|
||||||
|
if(status == 0){
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ public class HttpUtils {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向指定 URL 发送POST方法的请求
|
* 向指定 URL 发送POST方法的请求
|
||||||
*
|
*
|
||||||
|
|
@ -129,8 +130,8 @@ public class HttpUtils {
|
||||||
// 设置通用的请求属性
|
// 设置通用的请求属性
|
||||||
conn.setRequestProperty("accept", "*/*");
|
conn.setRequestProperty("accept", "*/*");
|
||||||
conn.setRequestProperty("connection", "Keep-Alive");
|
conn.setRequestProperty("connection", "Keep-Alive");
|
||||||
conn.setRequestProperty("user-agent",
|
conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
||||||
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||||
// 发送POST请求必须设置如下两行
|
// 发送POST请求必须设置如下两行
|
||||||
conn.setDoOutput(true);
|
conn.setDoOutput(true);
|
||||||
conn.setDoInput(true);
|
conn.setDoInput(true);
|
||||||
|
|
@ -172,5 +173,4 @@ public class HttpUtils {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue