| | |
| | | import com.sinata.core.common.constant.factory.ConstantFactory; |
| | | import com.sinata.core.common.constant.state.ManagerStatus; |
| | | import com.sinata.core.shiro.ShiroUser; |
| | | import com.sinata.core.shiro.factory.IShiro; |
| | | import com.sinata.core.util.Convert; |
| | | import com.sinata.core.util.SpringContextHolder; |
| | | import com.sinata.modular.system.dao.MenuMapper; |
| | |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.crypto.hash.Md5Hash; |
| | | import org.apache.shiro.util.ByteSource; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.DependsOn; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | @Transactional(readOnly = true) |
| | | public class ShiroFactroy implements com.sinata.core.shiro.factory.IShiro { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private UserMapper userMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private MenuMapper menuMapper; |
| | | |
| | | public static com.sinata.core.shiro.factory.IShiro me() { |
| | |
| | | roleNameList.add(ConstantFactory.me().getSingleRoleName(roleId)); |
| | | } |
| | | shiroUser.setRoleList(roleList); |
| | | shiroUser.setCityCode(user.getProvinceCode()); |
| | | shiroUser.setRoleNames(roleNameList); |
| | | |
| | | return shiroUser; |
| | | } |
| | | |