悠谷渠道小七专服

master
duhui 2022-12-28 14:25:01 +08:00
parent d875e2c443
commit 7d15eee93f
3 changed files with 16 additions and 12 deletions

View File

@ -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"));

View File

@ -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;

View File

@ -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,9 +48,6 @@ 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 {
//正式服appId
VerifyParams params = new VerifyParams();
@ -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;