悠谷渠道小七专服

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("QUICK2", new QuickVerifyService2("QUICK2"));
serviceMap.put("QUICK3", new QuickVerifyService3("QUICK3")); serviceMap.put("QUICK3", new QuickVerifyService3("QUICK3"));
serviceMap.put("YOUGU", new YouGuVerifyService("YG")); serviceMap.put("YOUGU", new YouGuVerifyService("YG"));
serviceMap.put("YGXQ", new YouGuVerifyService("YGXQ"));
serviceMap.put("DUOYOU", new DuoYouVerifyService("DUOYOU")); serviceMap.put("DUOYOU", new DuoYouVerifyService("DUOYOU"));
serviceMap.put("AIWAN", new AiWanVerifyService("AIWAN")); serviceMap.put("AIWAN", new AiWanVerifyService("AIWAN"));
serviceMap.put("HF", new HFVerifyService("HF")); 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_app_id;
public static String caohua_secret_key; public static String caohua_secret_key;
public String sign;
private String sign;
public AbstractVerifyService(String sign) { public AbstractVerifyService(String sign) {
this.sign = sign; this.sign = sign;

View File

@ -36,7 +36,10 @@ public class YouGuVerifyService extends AbstractVerifyService {
LOGGER.error("test verify fail"); LOGGER.error("test verify fail");
return false; return false;
} }
} else if (!"3".equals(platform) ) {//正式 切不是pc return true;
}
if (!"3".equals(platform) ) {//正式 切不是pc
String sub_channel = request.getParameter("sub_channel"); String sub_channel = request.getParameter("sub_channel");
boolean result = false; boolean result = false;
if (sub_channel != null && !sub_channel.equals("")) { if (sub_channel != null && !sub_channel.equals("")) {
@ -45,10 +48,7 @@ public class YouGuVerifyService extends AbstractVerifyService {
VerifyParams params = new VerifyParams(); VerifyParams params = new VerifyParams();
VerifyParams testParam = getTestParam(params,request, openId, token); VerifyParams testParam = getTestParam(params,request, openId, token);
result = verifyTest(testParam); result = verifyTest(testParam);
} else if(sub_channel.equals("20201222")){ }else {
//商务服
//result = loginVerfifyShangwu("MHT", openId, token, MHTSDKConstans.rhappIdshangwu);
} else {
//正式服appId //正式服appId
VerifyParams params = new VerifyParams(); VerifyParams params = new VerifyParams();
VerifyParams formatParam = getFormatParam(params,request, openId, token); VerifyParams formatParam = getFormatParam(params,request, openId, token);
@ -80,8 +80,14 @@ public class YouGuVerifyService extends AbstractVerifyService {
@Override @Override
boolean doVerify(VerifyParams params) { boolean doVerify(VerifyParams params) {
LOGGER.info("YouGuVerifyService登录验证-->{}",params.getOpenId());
String url = "http://smi.648sy.com/tcx/auth"; 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<>(); Map<String,String> parms = new HashMap<>();
parms.put("token",params.getToken()); parms.put("token",params.getToken());
parms.put("uid",params.getOpenId()); parms.put("uid",params.getOpenId());
@ -90,12 +96,12 @@ public class YouGuVerifyService extends AbstractVerifyService {
String r = HttpUtils.doPost(url, parms); String r = HttpUtils.doPost(url, parms);
JSONObject jsonObject = JSON.parseObject(r); JSONObject jsonObject = JSON.parseObject(r);
int errno = jsonObject.getIntValue("errno"); int errno = jsonObject.getIntValue("errno");
LOGGER.info("YouGuVerifyService请求结果:{}",r); LOGGER.info("{}请求结果:{}",log,r);
if(errno == 0){ if(errno == 0){
result = true; result = true;
} }
}catch (IOException e){ }catch (IOException e){
LOGGER.info("YouGuVerifyService验证失败,IOException"); LOGGER.info("{}验证失败,{}",log,e.getMessage());
return false; return false;
} }
return result; return result;
@ -103,7 +109,6 @@ public class YouGuVerifyService extends AbstractVerifyService {
@Override @Override
protected VerifyParams getTestParam(VerifyParams params, HttpServletRequest request, String openId, String token) { protected VerifyParams getTestParam(VerifyParams params, HttpServletRequest request, String openId, String token) {
params.setChannel("YouGu");
params.setToken(token); params.setToken(token);
params.setOpenId(openId); params.setOpenId(openId);
return params; return params;
@ -111,7 +116,6 @@ public class YouGuVerifyService extends AbstractVerifyService {
@Override @Override
protected VerifyParams getFormatParam(VerifyParams params, HttpServletRequest request, String openId, String token) { protected VerifyParams getFormatParam(VerifyParams params, HttpServletRequest request, String openId, String token) {
params.setChannel("YouGu");
params.setToken(token); params.setToken(token);
params.setOpenId(openId); params.setOpenId(openId);
return params; return params;