公会8渠道

master
grimm 2024-05-31 14:47:47 +08:00
parent 47fcc2fa76
commit 1951c5bb3f
2 changed files with 44 additions and 0 deletions

View File

@ -54,6 +54,7 @@ public class GetUserController extends HttpServlet {
serviceMap.put("ZZXX", new ZzxxVerifyService("ZZXX")); serviceMap.put("ZZXX", new ZzxxVerifyService("ZZXX"));
serviceMap.put("AQLM", new AQLMVerifyService("AQLM")); serviceMap.put("AQLM", new AQLMVerifyService("AQLM"));
serviceMap.put("AQLMYJ", new YgAqlmYjVerifyService("AQLMYJ")); serviceMap.put("AQLMYJ", new YgAqlmYjVerifyService("AQLMYJ"));
serviceMap.put("GOHU", new GonghuiVerifyService("GOHU"));
serviceMap.put("WYDDS", new EightUVerifyService("WYDDS")); serviceMap.put("WYDDS", new EightUVerifyService("WYDDS"));
} }

View File

@ -0,0 +1,43 @@
package com.ljsd.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ljsd.pojo.VerifyParams;
import com.ljsd.util.HttpUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class GonghuiVerifyService extends YouGuVerifyService {
private static final Logger LOGGER = LoggerFactory.getLogger(GonghuiVerifyService.class);
public GonghuiVerifyService(String sign) {
super(sign);
}
@Override
boolean doVerify(VerifyParams params) {
String loginUrl = "http://smi.648sy.com/tcxldyzgh8zf/auth";
LOGGER.info("公会8渠道登录验证-->{}",params.getOpenId());
Map<String,String> parms = new HashMap<>();
parms.put("token",params.getToken());
parms.put("uid",params.getOpenId());
boolean result = false;
try {
String r = HttpUtils.doPost(loginUrl, parms);
JSONObject jsonObject = JSON.parseObject(r);
int errno = jsonObject.getIntValue("errno");
LOGGER.info("公会8渠道登录验证请求结果:{}",r);
if(errno == 0){
result = true;
}
}catch (IOException e){
LOGGER.info("公会8渠道登录验证验证失败,{}",e.getMessage());
return false;
}
return result;
}
}