Commit 0f289e4a authored by 赵啸非's avatar 赵啸非

修改设备管理

parent 7c0a8e70
......@@ -16,10 +16,10 @@ import org.springframework.context.annotation.ImportResource;
@ImportResource(locations = {"classpath:config/spring-config.xml"})
public class ManagerApplication extends BaseWebApplication {
@Bean
/* @Bean
public ICacheService cacheService() {
return new LocalCacheServiceImpl();
}
}*/
public static void main(String[] args) {
SpringApplication.run(ManagerApplication.class, args);
......
......@@ -138,10 +138,7 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
public String index(HttpServletRequest request, HttpServletResponse response) throws Exception {
JSONObject ret = new JSONObject();
IUser user = this.getCurUser();
log.info("user is null:{}",user==null);
if (user == null) {
return "";
// user = super.getCurUser();
// if (user == null) {
......@@ -149,16 +146,12 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
// }
}
Set<String> urls = resourceService.findUrlSetByUserId(user.getId());
log.info("urls:{}",JSON.toJSONString(urls));
List<MenuEntity> outlookBarList = menuService.findTreeMenu(user, urls);
log.info("outlookBarList:{}",JSON.toJSONString(outlookBarList));
String currUserName = user.getRealName();
if (currUserName == null || currUserName.trim().length() == 0) {
currUserName = "管理员";
}
log.info("saveCurrUser11111111");
this.saveCurrUser(request, response, user,604800);
log.info("saveCurrUser");
this.saveCurrUser(request, response, user);
JSONObject data = new JSONObject();
data.put("currUserName", currUserName);
data.put("barList", outlookBarList);
......@@ -170,7 +163,6 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "用户登录系统成功!");
ret.put("resources", urls);
log.info("resp:{}",ret.toJSONString());
return ret.toJSONString();
}
......@@ -310,8 +302,6 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
@Override
protected void saveCurrUser(HttpServletRequest request, HttpServletResponse response, IUser user, int maxAge) {
String securityKey = GlobalSysInfo.getPropertyValue(SysConstains.PROP_COOKIE_SECURITY_KEY);
log.info("securityKey:"+securityKey);
String cookieDomain = GlobalSysInfo.getPropertyValue(SysConstains.PROP_COOKIE_DOMAIN);
String currDoman = request.getServerName();
CookieInfo cookie = setLoginCookie(response, user, securityKey, currDoman, maxAge);
......
......@@ -58,7 +58,6 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
Set<Long> authIds = new HashSet<>();
Map<Long, MenuEntity> menuMap = new HashMap<>();
List<MenuEntity> userModuleList = this.findAllEnable();
log.info("userModuleList:{}", JSON.toJSONString(userModuleList));
for (MenuEntity sysModule : userModuleList) {
if (sysModule == null) {
continue;
......@@ -68,16 +67,13 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
authIds.add(sysModule.getId());
}
}
log.info("authIds:{}", JSON.toJSONString(authIds));
if (!user.isAdmin()) {
Long[] ids = authIds.toArray(new Long[authIds.size()]);
for (Long id : ids) {
MenuEntity menu = menuMap.get(id);
log.info("id:{} to menu:{}",id, JSON.toJSONString(menu));
while (menu != null) {
authIds.add(menu.getId());
menu = menuMap.get(menu.getParentId());
log.info(" menu:{}", JSON.toJSONString(menu));
}
}
}
......
......@@ -79,7 +79,7 @@
<profiles.redis.uri>192.168.0.26</profiles.redis.uri>
<profiles.redis.port>6379</profiles.redis.port>
<profiles.redis.username></profiles.redis.username>
<profiles.redis.password></profiles.redis.password>
<profiles.redis.password>gheirred</profiles.redis.password>
<profiles.redis.database>2</profiles.redis.database>
<profiles.filepath>/mortals/data</profiles.filepath>
<profiles.log.level>INFO</profiles.log.level>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment