|
@@ -66,12 +66,9 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
|
|
return createLoginUser(user);
|
|
|
} else if (StudentLoginTypeEnum.AUTHORIZATION_CODE_LOGIN.getCode().equals(loginType)){
|
|
|
{
|
|
|
- //由于之前没有保存用户unionid,只有openid,所以这里判定两个都不存在才不存在用户
|
|
|
UserInfo userInfoGetByUnionId = userService.getStudentByUnionId(identification);
|
|
|
String openid = (String)ServletUtils.getRequest().getAttribute("openid");
|
|
|
- UserInfo userInfoGetByOpenId = userService.getStudentByOpenId(openid);
|
|
|
- String third = (String)ServletUtils.getRequest().getAttribute("third");
|
|
|
- if (userInfoGetByUnionId == null && userInfoGetByOpenId == null) {
|
|
|
+ if (userInfoGetByUnionId == null ) {
|
|
|
UserInfo userInfo = new UserInfo();
|
|
|
userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
|
|
|
userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
|
|
@@ -81,84 +78,40 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
|
|
userService.saveUserInfo(userInfo);
|
|
|
return createLoginUser(userService.getStudentByUnionId(identification));
|
|
|
}else {
|
|
|
- UserInfo userInfo = userInfoGetByUnionId != null ? userInfoGetByUnionId:userInfoGetByOpenId;
|
|
|
+ UserInfo userInfo = userInfoGetByUnionId ;
|
|
|
userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
|
|
|
userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
|
|
|
- userInfo.setUnionId(identification);
|
|
|
userService.updateStudent(userInfo);
|
|
|
return createLoginUser(userService.getStudentByUnionId(identification));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- else if (StudentLoginTypeEnum.AUTHORIZATION_CODE_GZH_LOGIN.getCode().equals(loginType)){
|
|
|
+ else if (StudentLoginTypeEnum.AUTHORIZATION_XCX_LOGIN.getCode().equals(loginType)){
|
|
|
{
|
|
|
- //由于之前没有保存用户unionid,只有openid,所以这里判定两个都不存在才不存在用户
|
|
|
UserInfo userInfoGetByUnionId = userService.getStudentByUnionId(identification);
|
|
|
- String gzhOpenid = (String)ServletUtils.getRequest().getAttribute("openid");
|
|
|
- if (userInfoGetByUnionId == null ) {
|
|
|
- UserInfo userInfo = new UserInfo();
|
|
|
- userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
|
|
|
- userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
|
|
|
- userInfo.setUnionId(identification);
|
|
|
- userInfo.setIsVip(0);
|
|
|
- userService.saveUserInfo(userInfo);
|
|
|
- return createLoginUser(userService.getStudentByUnionId(identification));
|
|
|
- }else {
|
|
|
- userInfoGetByUnionId.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
|
|
|
- userInfoGetByUnionId.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
|
|
|
- userService.updateStudent(userInfoGetByUnionId);
|
|
|
- return createLoginUser(userService.getStudentByUnionId(identification));
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- else if (StudentLoginTypeEnum.AUTHORIZATION_CODE_DY_LOGIN.getCode().equals(loginType)){
|
|
|
- UserInfo userInfoGetByUnionId = userService.getStudentByUnionId(identification);
|
|
|
- String openid = (String)ServletUtils.getRequest().getAttribute("openid");;
|
|
|
- String third = (String)ServletUtils.getRequest().getAttribute("third");
|
|
|
+ String openid = (String)ServletUtils.getRequest().getAttribute("openid");
|
|
|
+ UserInfo userInfoGetByOpenId = userService.getStudentByOpenId(openid);
|
|
|
if (userInfoGetByUnionId == null ) {
|
|
|
UserInfo userInfo = new UserInfo();
|
|
|
userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
|
|
|
userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
|
|
|
- userInfo.setAppOpenid(openid);
|
|
|
+ userInfo.setXcxOpenid(openid);
|
|
|
userInfo.setUnionId(identification);
|
|
|
userInfo.setIsVip(0);
|
|
|
userService.saveUserInfo(userInfo);
|
|
|
return createLoginUser(userService.getStudentByUnionId(identification));
|
|
|
}else {
|
|
|
- UserInfo userInfo = userInfoGetByUnionId;
|
|
|
+ UserInfo userInfo = userInfoGetByUnionId ;
|
|
|
userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
|
|
|
userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
|
|
|
- userInfo.setAppOpenid(openid);
|
|
|
userService.updateStudent(userInfo);
|
|
|
return createLoginUser(userService.getStudentByUnionId(identification));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- }
|
|
|
- else if (StudentLoginTypeEnum.AUTHORIZATION_CODE_TT_LOGIN.getCode().equals(loginType)){
|
|
|
- UserInfo userInfoGetByUnionId = userService.getStudentByUnionId(identification);
|
|
|
- String openid = (String)ServletUtils.getRequest().getAttribute("openid");;
|
|
|
- String third = (String)ServletUtils.getRequest().getAttribute("third");
|
|
|
- if (userInfoGetByUnionId == null ) {
|
|
|
- UserInfo userInfo = new UserInfo();
|
|
|
-// userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
|
|
|
-// userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
|
|
|
- userInfo.setUnionId(identification);
|
|
|
- userInfo.setIsVip(0);
|
|
|
- userService.saveUserInfo(userInfo);
|
|
|
- return createLoginUser(userService.getStudentByUnionId(identification));
|
|
|
- }else {
|
|
|
- UserInfo userInfo = userInfoGetByUnionId;
|
|
|
-// userInfo.setHeadImage((String) ServletUtils.getRequest().getAttribute("headImage"));
|
|
|
-// userInfo.setNickName((String) ServletUtils.getRequest().getAttribute("nickName"));
|
|
|
- userService.updateStudent(userInfo);
|
|
|
- return createLoginUser(userService.getStudentByUnionId(identification));
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
else if (StudentLoginTypeEnum.IOS_CODE_LOGIN.getCode().equals(loginType)){
|
|
|
{
|
|
|
UserInfo userInfo = userService.getStudentByOpenId(identification);
|