generated from root/miduo_server
新增登录sdk
parent
dd01af3454
commit
af4c89c131
|
@ -74,7 +74,10 @@ public class GetUserController extends HttpServlet {
|
|||
serviceMap.put("U1GAME", new U1GameVerifyService("U1GAME"));
|
||||
serviceMap.put("FENGTI", new FengTiVerifyService("FENGTI"));
|
||||
//太初行027渠道
|
||||
serviceMap.put("TCX027", new FengTiVerifyService("TCX027"));
|
||||
serviceMap.put("TCX027", new Tcx027VerifyService("TCX027"));
|
||||
serviceMap.put("TCX02702", new Tcx02702VerifyService("TCX02702"));
|
||||
//太初行quick直播渠道
|
||||
serviceMap.put("TCXQUZB", new QuickTcxZbVerifyService("TCXQUZB"));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package com.ljsd.service;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 太初行quick直播渠道
|
||||
*/
|
||||
public class QuickTcxZbVerifyService extends QuickVerifyService {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(QuickxyzbVerifyService.class);
|
||||
public final static String product_code = "17710308991857836243715376685067";
|
||||
|
||||
public QuickTcxZbVerifyService(String sign) {
|
||||
super(sign);
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean doVerify(VerifyParams params) {
|
||||
LOGGER.info("quick 太初行直播 登录验证-->{}",params.getOpenId());
|
||||
String url = "http://checkuser.quickapi.net/v2/checkUserInfo";
|
||||
Map<String,String> parms = new HashMap<>();
|
||||
parms.put("token",params.getToken());
|
||||
parms.put("product_code", product_code);
|
||||
parms.put("uid",params.getOpenId());
|
||||
boolean result = false;
|
||||
try {
|
||||
String r = HttpUtils.doPost(url, parms);
|
||||
LOGGER.info("quick 太初行直播 请求结果:{}",r);
|
||||
if (r != null && r.equals("1")) {
|
||||
result = true;
|
||||
}
|
||||
}catch (IOException e){
|
||||
LOGGER.info("quick 太初行直播 验证失败,IOException:{}",e.getMessage());
|
||||
return false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.ljsd.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ljsd.pojo.VerifyParams;
|
||||
import com.ljsd.util.AppConstans;
|
||||
import com.ljsd.util.HttpUtils;
|
||||
import com.ljsd.util.MD5Util;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class Tcx02702VerifyService extends Tcx027VerifyService {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(FengTiVerifyService.class);
|
||||
public static int isTestLan=0;
|
||||
public final static String serverKey = "bb0f57f8061eaca83a8e172536f3704d";
|
||||
|
||||
public Tcx02702VerifyService(String sign) {
|
||||
super(sign);
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean doVerify(VerifyParams params) {
|
||||
String url = "http://sdk.user.i.027gm.com/game/verify/login";
|
||||
LOGGER.info("027登录验证-->{}",params.getOpenId());
|
||||
Map<String,String> parms = new HashMap<>();
|
||||
String token = params.getToken();
|
||||
String appId = params.getAppId();
|
||||
parms.put("token",token);
|
||||
parms.put("appId",appId);
|
||||
String sign = MD5Util.encrypByMd5(appId + serverKey + token);
|
||||
parms.put("sign",sign);
|
||||
boolean result = false;
|
||||
try {
|
||||
String r = HttpUtils.doPost(url, parms);
|
||||
LOGGER.info("027登录结果:{}",r);
|
||||
JSONObject jsonObject = JSON.parseObject(r);
|
||||
int status = jsonObject.getIntValue("status");
|
||||
if(status == 1 ){
|
||||
result = true;
|
||||
}else{
|
||||
if(status == 1001){
|
||||
LOGGER.info("sign error status : ",status);
|
||||
}
|
||||
result = false;
|
||||
}
|
||||
}catch (IOException e){
|
||||
LOGGER.info("027验证失败,{}",e.getMessage());
|
||||
return false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -96,7 +96,15 @@ public class Tcx027VerifyService extends AbstractVerifyService {
|
|||
String r = HttpUtils.doPost(url, parms);
|
||||
LOGGER.info("027登录结果:{}",r);
|
||||
JSONObject jsonObject = JSON.parseObject(r);
|
||||
result = jsonObject.getBoolean("status");
|
||||
int status = jsonObject.getIntValue("status");
|
||||
if(status == 1 ){
|
||||
result = true;
|
||||
}else{
|
||||
if(status == 1001){
|
||||
LOGGER.info("sign error status : ",status);
|
||||
}
|
||||
result = false;
|
||||
}
|
||||
}catch (IOException e){
|
||||
LOGGER.info("027验证失败,{}",e.getMessage());
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue