Ver código fonte

BUG修复

Signed-off-by: anderx <312518615@qq.com>
anderx 5 anos atrás
pai
commit
c0c7df6f49

+ 0 - 3
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -20,7 +20,6 @@ import org.springframework.web.servlet.ModelAndView;
 
 import com.goafanti.achievement.service.AchievementInterestService;
 import com.goafanti.achievement.service.AchievementService;
-import com.goafanti.admin.bo.AdminVideoBo;
 import com.goafanti.admin.service.AdminVideoService;
 import com.goafanti.app.bo.ExpertsListBo;
 import com.goafanti.banners.service.BannersService;
@@ -60,7 +59,6 @@ import com.goafanti.news.service.NewsService;
 import com.goafanti.news.service.PolicyService;
 import com.goafanti.portal.bo.AchievementObject;
 import com.goafanti.user.bo.OrgIdentityBo;
-import com.goafanti.user.bo.UserIdentityBo;
 import com.goafanti.user.service.OrganizationIdentityService;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserService;
@@ -354,7 +352,6 @@ public class WebpageController extends BaseController {
 	/**
 	 * 服务汇
 	 */
-	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/portal/service/serviceIndex", method = RequestMethod.GET)
 	public ModelAndView portalServiceServiceIndex(HttpServletRequest request, ModelAndView modelview) {
 		modelview.setViewName("/portal/service/services");

+ 4 - 5
src/main/java/com/goafanti/core/shiro/token/UserRealm.java

@@ -52,7 +52,6 @@ public class UserRealm extends AuthorizingRealm {
 	 */
 	protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authcToken)
 			throws AuthenticationException {
-		System.out.println("进入登陆授权");
 		ShiroToken token = (ShiroToken) authcToken;
 		if (null == token.getType()) {
 			Admin admin = adminService.selectByMobile(token.getUsername(),"超级管理员");
@@ -86,13 +85,13 @@ public class UserRealm extends AuthorizingRealm {
 	 */
 	@Override
 	protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
-		System.out.println("进入角色授权");
-		int type=TokenManager.getUserType();
-		System.out.println(type);
+		Integer type=TokenManager.getUserType();
+//		Admin a =TokenManager.getAdminToken();
+//		Integer type=a.getType();
 		String userId = TokenManager.getAdminId();
 		SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
 		// 根据用户ID查询角色(role),放入到Authorization里。
-		if (type==3) {
+		if (type!= null && type==3) {
 			Set<String> roles = skjtUserMapper.findRoleByUserId(userId);
 			info.setRoles(roles);
 			// 根据用户ID查询权限(permission),放入到Authorization里。