小程序登录返回unionId

master
shijie 4 years ago
parent 4703cdfbf5
commit 8b6804b888
  1. 5
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java
  2. 2
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/Login.java

@ -343,9 +343,12 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
System.out.println(line); //这里需要使用fastjson来提取一下内容
JSONObject jsonObject= JSON.parseObject(line);
Login login=new Login();
System.out.println("jsonObject====================="+jsonObject);
System.out.println("unionId==================="+jsonObject.getString("unionid"));
login.setOpenid(jsonObject.getString("openid"));
login.setSession_key(jsonObject.getString("session_key"));
result.append(login.getOpenid());
login.setUnionid(jsonObject.getString("unionid"));
result.append(login.getUnionid());
System.out.println(result.toString());
}
} catch (IOException e) {

@ -28,4 +28,6 @@ public class Login implements Serializable {
private String session_key;
private String unionid;
}

Loading…
Cancel
Save