| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.UserInfMapper; |
| | | import com.whyc.pojo.db_lithium_ram_db.DevInf; |
| | | import com.whyc.pojo.db_user.UserInf; |
| | | import com.whyc.util.MD5Util; |
| | | import com.whyc.util.RSAUtil; |
| | |
| | | import javax.servlet.ServletContext; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | if(list!=null&&list.size()>0){ |
| | | return new Response().setII(1,false,list,"用户名已存在"); |
| | | } |
| | | uinf.setCreateTime(new Date()); |
| | | int bl=mapper.insert(uinf); |
| | | return new Response().set(1,bl>0); |
| | | } |
| | |
| | | //登录成功 |
| | | ServletContext servletContext = request.getServletContext(); |
| | | servletContext.setAttribute(uname, request.getSession().getId()); |
| | | request.getSession().setMaxInactiveInterval(60*30); |
| | | //Session存储当前用户及权限组列表 |
| | | UserInf userDB = (UserInf) subject.getPrincipal(); |
| | | userDB.setUsnid(null); |
| | |
| | | List<UserInf> list=mapper.selectList(wrapper); |
| | | return new Response().setII(1,list!=null,list,"查询所有用户信息(不分页用于包机组)"); |
| | | } |
| | | //根据uId获取设备信息 |
| | | public UserInf getUinfByUId(int uId){ |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("uid",uId); |
| | | wrapper.last("limit 1"); |
| | | UserInf uinf=mapper.selectOne(wrapper); |
| | | return uinf; |
| | | } |
| | | } |