| @@ -95,6 +95,7 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { | |||||
| @Override | @Override | ||||
| public ResultData updatepwd(String appId, String phone, String code, String pwd) { | public ResultData updatepwd(String appId, String phone, String code, String pwd) { | ||||
| WxAppinfo appinfo = wxAppinfoMapper.findByAppId(appId); | |||||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | ||||
| wxMsgValidationcode.setPhone(phone); | wxMsgValidationcode.setPhone(phone); | ||||
| wxMsgValidationcode.setCode(code); | wxMsgValidationcode.setCode(code); | ||||
| @@ -105,15 +106,13 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { | |||||
| if(wxmsgvalidationcodelist.size()>0){ | if(wxmsgvalidationcodelist.size()>0){ | ||||
| //更新 | //更新 | ||||
| WxMerchantBUser bUser = new WxMerchantBUser(); | WxMerchantBUser bUser = new WxMerchantBUser(); | ||||
| bUser.setTenantId(appinfo.getTenantId()); | |||||
| bUser.setPhone(phone); | bUser.setPhone(phone); | ||||
| bUser.setAppId(appId); | |||||
| List<WxMerchantBUser> list = wxMerchantBUserMapper.findList(bUser); | List<WxMerchantBUser> list = wxMerchantBUserMapper.findList(bUser); | ||||
| if(list.size()>0){ | if(list.size()>0){ | ||||
| bUser = list.get(0); | bUser = list.get(0); | ||||
| if (bUser.getAppId().equalsIgnoreCase(appId)) | |||||
| { | |||||
| logger.error("B端用户不是这个app的用户:" + appId); | |||||
| throw new MallinkException(ErrorCode.BUSER_NOT_IN_APP); | |||||
| } | |||||
| bUser.setBUserPwd(pwd); | bUser.setBUserPwd(pwd); | ||||
| try{ | try{ | ||||
| wxMerchantBUserMapper.updateByPrimaryKeySelective(bUser); | wxMerchantBUserMapper.updateByPrimaryKeySelective(bUser); | ||||
| @@ -121,6 +120,9 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { | |||||
| logger.error("db failed: 商户-" + bUser.getId() + ", e:" + e.getMessage()); | logger.error("db failed: 商户-" + bUser.getId() + ", e:" + e.getMessage()); | ||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | ||||
| } | } | ||||
| } else { | |||||
| logger.error("B端用户不是这个app的用户:" + appId); | |||||
| throw new MallinkException(ErrorCode.BUSER_NOT_IN_APP); | |||||
| } | } | ||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||