|
@@ -73,7 +73,6 @@ public class WxaUserApiController extends WxaController {
|
|
|
doctorsWechat.setCreateAt(new Date());
|
|
|
doctorsWechat.setUpdateAt(new Date());
|
|
|
doctorsWechat.save();
|
|
|
- doctorsWechatfind = doctorsWechat;
|
|
|
} else {
|
|
|
doctorsWechatfind.setUpdateAt(new Date());
|
|
|
doctorsWechatfind.update();
|
|
@@ -81,23 +80,21 @@ public class WxaUserApiController extends WxaController {
|
|
|
accessTokenCache.set("wxa:session:" + sessionId, apiResult.getJson());
|
|
|
LoginBean loginBean = new LoginBean();
|
|
|
loginBean.setSessionId(sessionId);
|
|
|
- String ssString = doctorsWechatfind.getDoctorId();
|
|
|
-// if (doctorsWechatfind.getDoctorId() != null) {
|
|
|
-// renderText("12121");
|
|
|
-// Doctors doctors = Doctors.dao.findById(doctorsWechatfind.getDoctorId());
|
|
|
-// doctors.setPassword("");
|
|
|
-// DoctorBean doctorBean = JSON.parseObject(doctors.toJson(), DoctorBean.class);
|
|
|
-// Institution institution = Institution.dao.findById(doctorBean.getInstitution_id());
|
|
|
-// doctorBean.setInstitution(institution.getName());
|
|
|
-// StringBuilder sb = new StringBuilder(doctorBean.getPhone());
|
|
|
-// sb.replace(3, 7, "****");
|
|
|
-// doctorBean.setPhone(sb.toString());
|
|
|
-// String tokenKey = "TOKEN_WXA_" + StrKit.getRandomUUID();
|
|
|
-// Redis.use("pc").setex("think" + tokenKey, 7200, doctors.toJson());
|
|
|
-// loginBean.setDoctorBean(doctorBean);
|
|
|
-// loginBean.setToken(tokenKey);
|
|
|
-// }
|
|
|
-// renderJson(new ResultBean(loginBean));
|
|
|
+ if (doctorsWechatfind != null) {
|
|
|
+ Doctors doctors = Doctors.dao.findById(doctorsWechatfind.getDoctorId());
|
|
|
+ doctors.setPassword("");
|
|
|
+ DoctorBean doctorBean = JSON.parseObject(doctors.toJson(), DoctorBean.class);
|
|
|
+ Institution institution = Institution.dao.findById(doctorBean.getInstitution_id());
|
|
|
+ doctorBean.setInstitution(institution.getName());
|
|
|
+ StringBuilder sb = new StringBuilder(doctorBean.getPhone());
|
|
|
+ sb.replace(3, 7, "****");
|
|
|
+ doctorBean.setPhone(sb.toString());
|
|
|
+ String tokenKey = "TOKEN_WXA_" + StrKit.getRandomUUID();
|
|
|
+ Redis.use("pc").setex("think" + tokenKey, 7200, doctors.toJson());
|
|
|
+ loginBean.setDoctorBean(doctorBean);
|
|
|
+ loginBean.setToken(tokenKey);
|
|
|
+ }
|
|
|
+ renderJson(new ResultBean(loginBean));
|
|
|
}
|
|
|
|
|
|
public void loginBySession() {
|