generated from root/miduo_server
正式服登录校验
parent
65e3008003
commit
cd8ba3fe13
|
@ -101,7 +101,15 @@ public class GetUserController extends HttpServlet {
|
|||
return;
|
||||
}
|
||||
}else if(!"3".equals(platform)){//正式 切不是pc
|
||||
boolean result = loginVerfify(pid, openId, token);
|
||||
String sub_channel = request.getParameter("sub_channel");
|
||||
boolean result =false;
|
||||
if(sub_channel!=null&&!sub_channel.equals("")){
|
||||
if(sub_channel.equals("1000")){
|
||||
result = loginVerfify(pid, openId, token,MHTSDKConstans.rhappid);
|
||||
}else {
|
||||
result = loginVerfify(pid, openId, token,MHTSDKConstans.rhappidOnline);
|
||||
}
|
||||
}
|
||||
if(!result){
|
||||
response.sendError(400, "verify fail");
|
||||
LOGGER.error("verify fail");
|
||||
|
@ -157,12 +165,12 @@ public class GetUserController extends HttpServlet {
|
|||
}
|
||||
|
||||
|
||||
public static boolean loginVerfify(String channelName,String openId,String token){
|
||||
public static boolean loginVerfify(String channelName,String openId,String token,String appId){
|
||||
try{
|
||||
String loginUrl = MHTSDKConstans.loginVerify;
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("userToken", token);
|
||||
params.put("appId", MHTSDKConstans.rhappid);
|
||||
params.put("appId", appId);
|
||||
params.put("channelName", channelName);
|
||||
params.put("uid", openId);
|
||||
String loginResult = HttpUtils.doPost(loginUrl,params);
|
||||
|
@ -199,7 +207,7 @@ public class GetUserController extends HttpServlet {
|
|||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
boolean mht = loginVerfify("MHT", "2318137", "bdcfa1c7febb1f7cc9d1c4ff14f1fc55");
|
||||
// boolean mht = loginVerfify("MHT", "2318137", "be385683efe228aadac0c8b5822a6fba");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
package com.ljsd.util;
|
||||
|
||||
/**
|
||||
* 游戏名称: 代号:源起
|
||||
* appid:b5122eb744689d247d82eea37e9741f6
|
||||
* rhappid:7bb5f604306ccd93fc19f05d3a374e84
|
||||
* 支付秘钥:5b980134872a8afa993f8a3b35a8efbd
|
||||
* channelid:MHT
|
||||
*/
|
||||
public class MHTSDKConstans {
|
||||
public static String appid = "e4ecefecc8034cffaa69e81b2c044f2c";
|
||||
public static String rhappid = "d0265404f55536a5c8b0ec33a9da27d3";
|
||||
public static String rhappidOnline = "7bb5f604306ccd93fc19f05d3a374e84";
|
||||
public static String back = "http://kwsdk.17173g.cn/platformPay/MHT/callBack";
|
||||
|
||||
// public static String androidVerify = "http://sujie.passport.ktsdk.com/user/verifyAccount";
|
||||
|
@ -12,6 +20,11 @@ public class MHTSDKConstans {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static String channelid = "MHT";
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
Loading…
Reference in New Issue