提交 8f659643 编写于 作者: Chongwen.jiang's avatar Chongwen.jiang

苹果登录数据存储修改

newUser字段去除
上级 826b1151
流水线 #22099 已失败 于阶段
in 0 second
......@@ -27,8 +27,6 @@ public class LoginResult {
private String mobile;
@ApiModelProperty("用户id,已经加密处理")
private String doctorId;
@ApiModelProperty("是否新用户 0:不是新用户,1:新用户")
private int newUser;
public String getToken() {
......@@ -87,11 +85,4 @@ public class LoginResult {
this.doctorId = doctorId;
}
public int getNewUser() {
return newUser;
}
public void setNewUser(int newUser) {
this.newUser = newUser;
}
}
......@@ -692,7 +692,7 @@ public class LoginServiceImpl implements LoginService {
} catch (Exception e) {
throw new PicaException("token格式错误", e.getMessage());
}
return this.verify(publicKey, identifyToken, aud, sub);
return this.verify(publicKey, identifyToken, aud, sub, request);
}
return false;
}
......@@ -705,7 +705,7 @@ public class LoginServiceImpl implements LoginService {
* @Params [key, jwt, audience, subject]
* @Return boolean
*/
private boolean verify(PublicKey key, String jwt, String audience, String subject) {
private boolean verify(PublicKey key, String jwt, String audience, String subject, BaseRequest request) {
JwtParser jwtParser = Jwts.parser().setSigningKey(key);
jwtParser.requireIssuer(Constants.APPLE_ISSUE_URL);
jwtParser.requireAudience(audience);
......@@ -715,6 +715,9 @@ public class LoginServiceImpl implements LoginService {
//logger.info("apple-verify-claim:{}", JSON.toJSONString(claim));
//logger.info("apple-verify-claim.getBody:{}", JSON.toJSONString(claim.getBody()));
if (claim != null && claim.getBody().containsKey("auth_time")) {
request.setInfo(JSON.toJSONString(claim.getBody()));
JSONObject claimBody = JSONObject.parseObject(JSON.toJSONString(claim.getBody()), JSONObject.class);
request.setAppleId(claimBody.getString("email"));
return true;
}
return false;
......
......@@ -146,8 +146,6 @@ public class RegisterServiceImpl implements RegisterService {
result.setEntireFlag(1);
result.setDoctorId(EncryptUtils.encryptContent(userId + "", EncryptConstants.ENCRYPT_TYPE_ID));
result.setMobile(mobile);
// 是新用户
result.setNewUser(1);
/* ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
try {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册