| | |
| | | package com.ruoyi.auth.service; |
| | | |
| | | import com.ruoyi.system.api.RemoteMemberService; |
| | | import com.ruoyi.system.api.RemoteShopService; |
| | | import com.ruoyi.system.api.domain.vo.ShopRelUserVo; |
| | | import com.ruoyi.system.api.model.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | @Autowired |
| | | private RemoteMemberService remoteMemberService; |
| | | |
| | | @Autowired |
| | | private RemoteShopService remoteShopService; |
| | | |
| | | @Autowired |
| | | private SysPasswordService passwordService; |
| | |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员"); |
| | | throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
| | | } |
| | | // 查询用户商户 |
| | | R<ShopRelUserVo> shopResult = remoteShopService.getShopByUserId(user.getUserId()); |
| | | if (R.FAIL == userResult.getCode()) { |
| | | throw new ServiceException(userResult.getMsg()); |
| | | } |
| | | ShopRelUserVo shopInfo = shopResult.getData(); |
| | | if(null == shopInfo){ |
| | | throw new ServiceException("未查询到商户信息"); |
| | | } |
| | | userInfo.setShopId(shopInfo.getShopId()); |
| | | |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功"); |
| | | |
| | | return userInfo; |
| | | } |
| | | |