|
|
|
@ -93,7 +93,8 @@ public class AppThirdLoginController { |
|
|
|
String userId = userOjb.getString("UserId"); |
|
|
|
|
|
|
|
UserBean userBean = userApi.getUserByUserStrId(userId); |
|
|
|
redisCache.setCacheObject("shiro:app:"+userBean.getStrUserId(), userBean); // todo:这里需要将转换出来的User存redis用于做权限
|
|
|
|
|
|
|
|
redisCache.setCacheObject("shiro:app:"+userBean.getUserId(), userBean); // todo:这里需要将转换出来的User存redis用于做权限
|
|
|
|
return thirdLoginService.szyLogin(userBean.getLoginName()); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
@ -194,9 +195,18 @@ public class AppThirdLoginController { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
log.info("================= data ================="); |
|
|
|
log.info(data); |
|
|
|
log.info("================= data ================="); |
|
|
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data); |
|
|
|
JSONObject userInfo = (JSONObject) jsonObject.get("data"); |
|
|
|
|
|
|
|
log.info("================= userInfo ================="); |
|
|
|
log.info(jsonObject.getString("data")); |
|
|
|
log.info(userInfo.toJSONString()); |
|
|
|
log.info("================= userInfo ================="); |
|
|
|
|
|
|
|
//添加深i企用户
|
|
|
|
Long userId = thirdLoginService.addSiqUser(userInfo); |
|
|
|
userInfo.put("userId", userId); |
|
|
|
@ -209,19 +219,24 @@ public class AppThirdLoginController { |
|
|
|
@PostMapping("/siqLoginTest") |
|
|
|
@ResponseBody |
|
|
|
public ZDResponse siqLoginTest(@RequestBody SiqLogin siqLogin){ |
|
|
|
String userIdCode = IdCardCryptoUtil.symmetricEncryptIdCard("eWIzY3BMRVNEQXhvUUlXMA==", siqLogin.getUserId()); |
|
|
|
String userNameCode = IdCardCryptoUtil.symmetricEncryptIdCard("eWIzY3BMRVNEQXhvUUlXMA==", siqLogin.getUserName()); |
|
|
|
String userIdCode = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, siqLogin.getUserId()); |
|
|
|
String userNameCode = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, siqLogin.getUserName()); |
|
|
|
|
|
|
|
log.info("================= siqLogin ================="); |
|
|
|
log.info(userIdCode); |
|
|
|
log.info(userNameCode); |
|
|
|
log.info("================= siqLogin ================="); |
|
|
|
|
|
|
|
Map<String,Object> heardMap = new HashMap<>(); |
|
|
|
heardMap.put("x-auth-channel", IdUtil.simpleUUID()); |
|
|
|
heardMap.put("x-auth-app-code","zfjdm"); |
|
|
|
String s = IdCardCryptoUtil.httpSendPost("http://egbpub.siqhz.com/egb/api/thirdauth/pub/auth/token",userIdCode,userNameCode,"zfjdm"); |
|
|
|
heardMap.put("x-auth-app-code",code); |
|
|
|
String s = IdCardCryptoUtil.httpSendPost(siqUrl+ "/pub/auth/token",userIdCode,userNameCode,"zfjdm"); |
|
|
|
|
|
|
|
String secret = IdCardCryptoUtil.symmetricEncryptIdCard("eWIzY3BMRVNEQXhvUUlXMA==", s); |
|
|
|
String secret = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, s); |
|
|
|
Map<String,Object> params = new HashMap<>(); |
|
|
|
params.put("accessKeySign",secret); |
|
|
|
params.put("appCode","zfjdm"); |
|
|
|
String data = HttpUtil.httpSendPost("http://egbpub.siqhz.com/egb/api/thirdauth/pub/auth/getUserInfo", JSONObject.toJSONString(params),new HashMap<>()); |
|
|
|
params.put("appCode",code); |
|
|
|
String data = HttpUtil.httpSendPost(siqUrl+ "/pub/auth/getUserInfo", JSONObject.toJSONString(params),new HashMap<>()); |
|
|
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data); |
|
|
|
JSONObject userInfo = (JSONObject) jsonObject.get("data"); |
|
|
|
|