socket为空时 报错问题
登录时 获取手机号乱码
This commit is contained in:
@@ -110,7 +110,6 @@ public class LoginContoller {
|
||||
String encryptedData = map.get("encryptedData");
|
||||
String ivStr = map.get("iv");
|
||||
// String phone = map.get("phone");
|
||||
log.info("登录传参:入参:{}",JSONUtil.toJSONString(map));
|
||||
// 用户非敏感信息:rawData
|
||||
// 签名:signature
|
||||
JSONObject rawDataJson = JSON.parseObject(rawData);
|
||||
@@ -128,10 +127,11 @@ public class LoginContoller {
|
||||
}
|
||||
String data = WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr);
|
||||
String phone = "";
|
||||
log.info("登录传参:解码获取手机号{}",data);
|
||||
if (ObjectUtil.isNotEmpty(data) && JSONObject.parseObject(data).containsKey("phoneNumber")) {
|
||||
phone =JSONObject.parseObject(data).get("phoneNumber").toString();
|
||||
}else {
|
||||
try{
|
||||
if (ObjectUtil.isNotEmpty(data) && JSONObject.parseObject(data).containsKey("phoneNumber")) {
|
||||
phone =JSONObject.parseObject(data).get("phoneNumber").toString();
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.info("登录传参:获取手机号失败{}",data);
|
||||
}
|
||||
String nickName = rawDataJson.getString("nickName");
|
||||
|
||||
Reference in New Issue
Block a user