|
@@ -52,6 +52,8 @@ public class WxUserServiceImpl extends ServiceImpl<IWxUserMapper, WxUser> implem
|
|
|
IWxService wxService;
|
|
|
@Autowired
|
|
|
IWxConfigService wxConfigService;
|
|
|
+ @Autowired
|
|
|
+ IWxUserService wxUserService;
|
|
|
|
|
|
@Override
|
|
|
public Object wxLogin(String code) {
|
|
@@ -72,6 +74,24 @@ public class WxUserServiceImpl extends ServiceImpl<IWxUserMapper, WxUser> implem
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public Object webLogin(String sessionId) {
|
|
|
+ if(StringUtils.isBlank(sessionId)){
|
|
|
+ throw new BusinessException(ResultCode.PARAM_MISS);
|
|
|
+ }
|
|
|
+ WxUser wxUser = wxUserService.getByOpenId(sessionId);
|
|
|
+ if(wxUser != null){
|
|
|
+ return wxUser;
|
|
|
+ }
|
|
|
+ wxUser = new WxUser();
|
|
|
+ wxUser.setWxUserId( MD5Utils.getPWD(RoomUtil.ev + sessionId));
|
|
|
+ wxUser.setOpenid(sessionId);
|
|
|
+ wxUser.setUnionid(sessionId);
|
|
|
+ wxUser.setSessionKey(sessionId);
|
|
|
+ this.save(wxUser);
|
|
|
+ return wxUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public WxUser addUser(WxOpenIdVo wxOpenIdVo) {
|
|
|
WxUser wxUser = this.getByOpenId(wxOpenIdVo.getOpenId());
|
|
|
if(wxUser != null){
|