提交 c6320015 作者: zhenjie

添加登录返回字段

上级 9ff9cb68
...@@ -28,4 +28,6 @@ public class AppUserSucVO implements Serializable { ...@@ -28,4 +28,6 @@ public class AppUserSucVO implements Serializable {
private String phoneNum; private String phoneNum;
@ApiModelProperty(value = "昵称") @ApiModelProperty(value = "昵称")
private String nickName; private String nickName;
@ApiModelProperty(value = "sessionKey")
private String sessionKey;
} }
...@@ -40,6 +40,7 @@ public class AuthServiceImpl implements AuthService { ...@@ -40,6 +40,7 @@ public class AuthServiceImpl implements AuthService {
public ResultBody appletLogin(WxLoginVO wxLoginVO) { public ResultBody appletLogin(WxLoginVO wxLoginVO) {
String unionId; String unionId;
String openId; String openId;
String sessionKey;
if (wxLoginVO.getFromPort().toString().equals(WxConstant.APP.toString())) { if (wxLoginVO.getFromPort().toString().equals(WxConstant.APP.toString())) {
//调用小程序登录接口,里面包含unionId //调用小程序登录接口,里面包含unionId
String appWxJson = wxService.appLogin(wxLoginVO); String appWxJson = wxService.appLogin(wxLoginVO);
...@@ -54,6 +55,7 @@ public class AuthServiceImpl implements AuthService { ...@@ -54,6 +55,7 @@ public class AuthServiceImpl implements AuthService {
} }
unionId = json.getString(WxConstant.UNION_ID); unionId = json.getString(WxConstant.UNION_ID);
openId = json.getString(WxConstant.OPEN_ID); openId = json.getString(WxConstant.OPEN_ID);
sessionKey = json.getString(WxConstant.SESSION_KEY);
}else if (wxLoginVO.getFromPort().equals(WxConstant.WEB)){ }else if (wxLoginVO.getFromPort().equals(WxConstant.WEB)){
//获取access_token接口,里面包含unionId //获取access_token接口,里面包含unionId
String pcWxJson = wxService.pcLogin(wxLoginVO); String pcWxJson = wxService.pcLogin(wxLoginVO);
...@@ -68,6 +70,7 @@ public class AuthServiceImpl implements AuthService { ...@@ -68,6 +70,7 @@ public class AuthServiceImpl implements AuthService {
} }
unionId = json.getString(WxConstant.UNION_ID); unionId = json.getString(WxConstant.UNION_ID);
openId = json.getString(WxConstant.OPEN_ID); openId = json.getString(WxConstant.OPEN_ID);
sessionKey = json.getString(WxConstant.SESSION_KEY);
}else { }else {
return ResultBody.error(ResultEnum.PARAM_ERROR); return ResultBody.error(ResultEnum.PARAM_ERROR);
} }
...@@ -91,6 +94,6 @@ public class AuthServiceImpl implements AuthService { ...@@ -91,6 +94,6 @@ public class AuthServiceImpl implements AuthService {
String token = JwtUtil.createJwt(map); String token = JwtUtil.createJwt(map);
return ResultBody.success(AppUserSucVO.builder().token(token).uid(userAccountVO.getUid()).phoneNum(userAccountVO.getPhoneNum()) return ResultBody.success(AppUserSucVO.builder().token(token).uid(userAccountVO.getUid()).phoneNum(userAccountVO.getPhoneNum())
.nickName(userAccountVO.getNickName()).userAccountId(userAccountVO.getId()).build()); .nickName(userAccountVO.getNickName()).userAccountId(userAccountVO.getId()).sessionKey(sessionKey).build());
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论