提交 c6320015 作者: zhenjie

添加登录返回字段

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