@RequestMapping("/list") public String selectuser(User user, HttpServletRequest request, HttpServletResponse response, Model model){ int defaultPageSize = 2; Page<User> userPage = new Page<User>(request,response,defaultPageSize); user.setPage(userPage); List<User> list = (List<User>) userService.selectUser(user); for (int i = 0; i<list.size();i++){ String con = list.get(i).getAccountType(); if (con.equals("1")){ list.get(i).setAccountType("网站账号"); } else if (con.equals("2")){ list.get(i).setAccountType("facebook "); } else if(con.equals("3")){ list.get(i).setAccountType("google"); } } userPage.setList(list); model.addAttribute("list",userPage); return "users/list"; }
对于数据库值为 1 2 3 在页面上需要根据值判断显示登陆账号类型
最新推荐文章于 2018-08-03 22:30:47 发布