爱趣联盟渠道

master
grimm 2024-04-03 14:26:12 +08:00
parent 0b01c34cca
commit 0f1d33aa9a
3 changed files with 46 additions and 2 deletions

View File

@ -50,7 +50,8 @@ public class GetUserController extends HttpServlet {
serviceMap.put("XQOT", new XqTenthVerifyService("XQOT")); serviceMap.put("XQOT", new XqTenthVerifyService("XQOT"));
serviceMap.put("AIQU", new AiquVerifyService("AIQU")); serviceMap.put("AIQU", new AiquVerifyService("AIQU"));
serviceMap.put("XQFP", new XqfpVerifyService("XQFP")); serviceMap.put("XQFP", new XqfpVerifyService("XQFP"));
serviceMap.put("ZZXX", new XqfpVerifyService("ZZXX")); serviceMap.put("ZZXX", new ZzxxVerifyService("ZZXX"));
serviceMap.put("AQLM", new AQLMVerifyService("AQLM"));
} }

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 AQLMVerifyService extends YouGuVerifyService {
private static final Logger LOGGER = LoggerFactory.getLogger(AQLMVerifyService.class);
public AQLMVerifyService(String sign) {
super(sign);
}
@Override
boolean doVerify(VerifyParams params) {
String loginUrl = "http://smi.648sy.com/tcxldlwzaqlmzf/auth";
LOGGER.info("爱趣联盟渠道登录验证-->{}",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("爱趣联盟渠道登录验证请求结果:{}",r);
if(errno == 0){
result = true;
}
}catch (IOException e){
LOGGER.info("爱趣联盟渠道登录验证验证失败,{}",e.getMessage());
return false;
}
return result;
}
}

View File

@ -42,7 +42,7 @@ public class YouGuVerifyService extends AbstractVerifyService {
if (!"3".equals(platform) ) {//正式 切不是pc 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.isEmpty()) {
if (sub_channel.equals("1000")) { if (sub_channel.equals("1000")) {
//测试服构建参数 //测试服构建参数
VerifyParams params = new VerifyParams(); VerifyParams params = new VerifyParams();