fuint-framework/fuint-base/src/main/java/com/fuint/base/service/Base/ShiroUserServiceImpl.java
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.fuint.base.service.Base;
import com.fuint.base.dao.entities.*;
import com.fuint.base.service.account.TAccountService;
import com.fuint.base.service.duty.TDutyService;
import com.fuint.base.service.platform.TPlatformService;
import com.fuint.base.service.source.TSourceService;
import com.fuint.base.shiro.ShiroUser;
import com.fuint.base.shiro.exception.AccountInvalidException;
import com.fuint.util.Encodes;
import org.apache.commons.collections.map.HashedMap;
import org.apache.shiro.authc.LockedAccountException;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.util.ByteSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* shiro user 接口
* Created by FSQ
* Contact wx fsq_better
*/
@Service
public class ShiroUserServiceImpl implements ShiroUserService {
private static final Logger logger = LoggerFactory.getLogger(ShiroUserServiceImpl.class);
@Autowired
private TAccountService tAccountService;
@Autowired
private TDutyService tDutyService;
@Autowired
private TSourceService tSourceService;
@Autowired
private TPlatformService tPlatformService;
/**
* 根据登录账户名称创建shiro user
*
* @param accountName
* @return
*/
@Override
public SimpleAuthenticationInfo createShiroUserByAccountName(String accountName) {
TAccount user = tAccountService.findByAccountName(accountName);
if (user != null) {
if (user.getLocked() == 1) {
logger.info("账户{}被锁定!", accountName);
throw new LockedAccountException(); //帐号锁定
}
if (user.getAccountStatus() == 0 || user.getIsActive() == 0) {
logger.info("账户{}无效!status={},activeStatus={}", accountName, user.getAccountStatus(), user.getIsActive());
throw new AccountInvalidException();
}
后面还有 49 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。