generated from root/miduo_server
悠谷渠道小七专服
parent
d875e2c443
commit
7d15eee93f
|
@ -39,6 +39,7 @@ public class GetUserController extends HttpServlet {
|
|||
serviceMap.put("QUICK2", new QuickVerifyService2("QUICK2"));
|
||||
serviceMap.put("QUICK3", new QuickVerifyService3("QUICK3"));
|
||||
serviceMap.put("YOUGU", new YouGuVerifyService("YG"));
|
||||
serviceMap.put("YGXQ", new YouGuVerifyService("YGXQ"));
|
||||
serviceMap.put("DUOYOU", new DuoYouVerifyService("DUOYOU"));
|
||||
serviceMap.put("AIWAN", new AiWanVerifyService("AIWAN"));
|
||||
serviceMap.put("HF", new HFVerifyService("HF"));
|
||||
|
|
|
@ -28,8 +28,7 @@ public abstract class AbstractVerifyService implements VerifyService {
|
|||
public static String caohua_app_id;
|
||||
public static String caohua_secret_key;
|
||||
|
||||
|
||||
private String sign;
|
||||
public String sign;
|
||||
|
||||
public AbstractVerifyService(String sign) {
|
||||
this.sign = sign;
|
||||
|
|
|
@ -36,7 +36,10 @@ public class YouGuVerifyService extends AbstractVerifyService {
|
|||
LOGGER.error("test verify fail");
|
||||
return false;
|
||||
}
|
||||
} else if (!"3".equals(platform) ) {//正式 切不是pc
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!"3".equals(platform) ) {//正式 切不是pc
|
||||
String sub_channel = request.getParameter("sub_channel");
|
||||
boolean result = false;
|
||||
if (sub_channel != null && !sub_channel.equals("")) {
|
||||
|
@ -45,10 +48,7 @@ public class YouGuVerifyService extends AbstractVerifyService {
|
|||
VerifyParams params = new VerifyParams();
|
||||
VerifyParams testParam = getTestParam(params,request, openId, token);
|
||||
result = verifyTest(testParam);
|
||||
} else if(sub_channel.equals("20201222")){
|
||||
//商务服
|
||||
//result = loginVerfifyShangwu("MHT", openId, token, MHTSDKConstans.rhappIdshangwu);
|
||||
} else {
|
||||
}else {
|
||||
//正式服appId
|
||||
VerifyParams params = new VerifyParams();
|
||||
VerifyParams formatParam = getFormatParam(params,request, openId, token);
|
||||
|
@ -80,8 +80,14 @@ public class YouGuVerifyService extends AbstractVerifyService {
|
|||
|
||||
@Override
|
||||
boolean doVerify(VerifyParams params) {
|
||||
LOGGER.info("YouGuVerifyService登录验证-->{}",params.getOpenId());
|
||||
String url = "http://smi.648sy.com/tcx/auth";
|
||||
String log = "youguVerifyService";
|
||||
|
||||
if (sign.equals("YGXQ")){
|
||||
url = "http://smi.648sy.com/tcxxqzf/auth";
|
||||
log = "youguXQVerifyService";
|
||||
}
|
||||
LOGGER.info("{}登录验证-->{}",log,params.getOpenId());
|
||||
Map<String,String> parms = new HashMap<>();
|
||||
parms.put("token",params.getToken());
|
||||
parms.put("uid",params.getOpenId());
|
||||
|
@ -90,12 +96,12 @@ public class YouGuVerifyService extends AbstractVerifyService {
|
|||
String r = HttpUtils.doPost(url, parms);
|
||||
JSONObject jsonObject = JSON.parseObject(r);
|
||||
int errno = jsonObject.getIntValue("errno");
|
||||
LOGGER.info("YouGuVerifyService请求结果:{}",r);
|
||||
LOGGER.info("{}请求结果:{}",log,r);
|
||||
if(errno == 0){
|
||||
result = true;
|
||||
}
|
||||
}catch (IOException e){
|
||||
LOGGER.info("YouGuVerifyService验证失败,IOException");
|
||||
LOGGER.info("{}验证失败,{}",log,e.getMessage());
|
||||
return false;
|
||||
}
|
||||
return result;
|
||||
|
@ -103,7 +109,6 @@ public class YouGuVerifyService extends AbstractVerifyService {
|
|||
|
||||
@Override
|
||||
protected VerifyParams getTestParam(VerifyParams params, HttpServletRequest request, String openId, String token) {
|
||||
params.setChannel("YouGu");
|
||||
params.setToken(token);
|
||||
params.setOpenId(openId);
|
||||
return params;
|
||||
|
@ -111,7 +116,6 @@ public class YouGuVerifyService extends AbstractVerifyService {
|
|||
|
||||
@Override
|
||||
protected VerifyParams getFormatParam(VerifyParams params, HttpServletRequest request, String openId, String token) {
|
||||
params.setChannel("YouGu");
|
||||
params.setToken(token);
|
||||
params.setOpenId(openId);
|
||||
return params;
|
||||
|
|
Loading…
Reference in New Issue