|
@@ -7,6 +7,9 @@ import com.ruoyi.common.enums.UserRegStatus;
|
|
|
import com.ruoyi.common.exception.ErrorException;
|
|
import com.ruoyi.common.exception.ErrorException;
|
|
|
import com.ruoyi.common.utils.PhoneUtils;
|
|
import com.ruoyi.common.utils.PhoneUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
|
+import com.ruoyi.dz.domain.DzCards;
|
|
|
|
|
+import com.ruoyi.dz.mapper.DzClassesMapper;
|
|
|
|
|
+import com.ruoyi.dz.mapper.DzSchoolMapper;
|
|
|
import com.ruoyi.dz.service.IDzCardsService;
|
|
import com.ruoyi.dz.service.IDzCardsService;
|
|
|
import com.ruoyi.framework.web.service.SysPasswordService;
|
|
import com.ruoyi.framework.web.service.SysPasswordService;
|
|
|
import com.ruoyi.framework.web.service.SysPermissionService;
|
|
import com.ruoyi.framework.web.service.SysPermissionService;
|
|
@@ -47,6 +50,10 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IDzCardsService dzCardsService;
|
|
private IDzCardsService dzCardsService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DzSchoolMapper dzSchoolMapper;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DzClassesMapper dzClassesMapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
|
|
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
|
|
@@ -73,7 +80,14 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
|
|
}
|
|
}
|
|
|
LoginCard card = new LoginCard();
|
|
LoginCard card = new LoginCard();
|
|
|
if(null != user.getCardId() && UserRegStatus.Student.equals(user.getRegStatus())) {
|
|
if(null != user.getCardId() && UserRegStatus.Student.equals(user.getRegStatus())) {
|
|
|
- BeanUtils.copyProperties(dzCardsService.selectDzCardsByCardId(user.getCardId()), card, "password");
|
|
|
|
|
|
|
+ DzCards dzCards = dzCardsService.selectDzCardsByCardId(user.getCardId());
|
|
|
|
|
+ BeanUtils.copyProperties(dzCards, card, "password");
|
|
|
|
|
+ if(null != dzCards.getSchoolId()) {
|
|
|
|
|
+ card.setSchoolName(dzSchoolMapper.selectDzSchoolById(dzCards.getSchoolId()).getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ if(null != dzCards.getClassId()) {
|
|
|
|
|
+ card.setClassName(dzClassesMapper.selectDzClassesByClassId(dzCards.getClassId()).getName());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
LoginUser loginUser = createLoginUser(user, card);
|
|
LoginUser loginUser = createLoginUser(user, card);
|
|
|
if(isPhoneLogin) {
|
|
if(isPhoneLogin) {
|