generated from root/miduo_server
master
parent
e77d1240e9
commit
45c189dfd3
|
|
@ -35,6 +35,7 @@ public class GetUserController extends HttpServlet {
|
||||||
//草花
|
//草花
|
||||||
serviceMap.put("CH",new CaohuaVerifyService("CH"));
|
serviceMap.put("CH",new CaohuaVerifyService("CH"));
|
||||||
serviceMap.put("QUICK", new QuickVerifyService("QUICK"));
|
serviceMap.put("QUICK", new QuickVerifyService("QUICK"));
|
||||||
|
serviceMap.put("QIANYOU", new QiYouVerifyService("huangjiayl&qypay"));
|
||||||
serviceMap.put("YX", new YxylVerifyService("YX"));
|
serviceMap.put("YX", new YxylVerifyService("YX"));
|
||||||
serviceMap.put("DY", new V3367VerifyService("DY"));
|
serviceMap.put("DY", new V3367VerifyService("DY"));
|
||||||
serviceMap.put("QUICK2", new QuickVerifyService2("QUICK2"));
|
serviceMap.put("QUICK2", new QuickVerifyService2("QUICK2"));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.ljsd.service;
|
||||||
|
|
||||||
|
import com.ljsd.pojo.VerifyParams;
|
||||||
|
import com.ljsd.util.AppConstans;
|
||||||
|
import com.ljsd.util.MD5Util;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乾游登录验证
|
||||||
|
*/
|
||||||
|
public class QiYouVerifyService extends AbstractVerifyService {
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(QiYouVerifyService.class);
|
||||||
|
public static int isTestLan=0;
|
||||||
|
|
||||||
|
public QiYouVerifyService(String sign) {
|
||||||
|
super(sign);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean verify(HttpServletResponse response, HttpServletRequest request, String admin, String platform, String pid, String openId, String token){
|
||||||
|
//如果是自己人不需要验证了
|
||||||
|
if(AppConstans.appsecret.equals(admin)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
String userId = request.getParameter("userId");
|
||||||
|
String platformId = request.getParameter("platformId");
|
||||||
|
String timestamp = request.getParameter("timestamp");
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
stringBuilder.append(userId).append(platformId).append(timestamp);
|
||||||
|
String sign = request.getParameter("sign");
|
||||||
|
String mySign = MD5Util.encrypByMd5(stringBuilder.toString());
|
||||||
|
if (mySign.equals(sign)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean verifyTest(VerifyParams params) {
|
||||||
|
return doVerify(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean verifyFormat(VerifyParams params) {
|
||||||
|
return doVerify(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
boolean doVerify(VerifyParams params) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected VerifyParams getTestParam(VerifyParams params, HttpServletRequest request, String openId, String token) {
|
||||||
|
params.setChannel("YouGu");
|
||||||
|
params.setToken(token);
|
||||||
|
params.setOpenId(openId);
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected VerifyParams getFormatParam(VerifyParams params, HttpServletRequest request, String openId, String token) {
|
||||||
|
params.setChannel("YouGu");
|
||||||
|
params.setToken(token);
|
||||||
|
params.setOpenId(openId);
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue