当前位置: 首页 > news >正文

如何建设软件下载网站为什么打开网址都是seo综合查询

如何建设软件下载网站,为什么打开网址都是seo综合查询,wordpress媒体库插件,wordpress半透明本方法因为是根据思路纯手写#xff0c;代码可以再简化#xff0c;功能尝试没问题#xff0c;最主要就是在登陆验证中的逻辑#xff0c;checkLogin()方法是登录前的验证#xff0c;而真正的登陆方式采用的是Shiro#xff0c;若不是采用Shiro登陆#xff0c;将该逻辑采用…本方法因为是根据思路纯手写代码可以再简化功能尝试没问题最主要就是在登陆验证中的逻辑checkLogin()方法是登录前的验证而真正的登陆方式采用的是Shiro若不是采用Shiro登陆将该逻辑采用到自己登陆的方法中即可实现一、用户验证必须字段  用户实体类中User.java添加一下字段可自选持久化工具本次采用jpa作为持久化工具除了用户id账户密码之外其中还必须有三个字段lastLoginErrorTime最后一次登陆错误时间、loginErrorcount登陆错误计数、isLocked是否锁定(0、未锁定1、锁定)EntityTable(name user_info)Cache(usage CacheConcurrencyStrategy.READ_WRITE)public class UserInfo implements Serializable{private static final long serialVersionUID 1L;/*** 用户模式(0,为管理员1为普通用户)*/Columnprivate Integer userModel1;//默认为普通用户//public static enum UserType {//SUPER, NORMAL//}/*** 主键*/IdColumn(name user_id)GeneratedValue(strategyGenerationType.AUTO)private Integer userId;/*** 登录帐号*/Column//(unique true)private String userName;/*** 用户密码*/Columnprivate String password;/*** 角色对应外键*/Columnprivate Integer roleId;/*** 部门对应外键*/Columnprivate Integer departmentId;/*** 添加时间*/Columnprivate Date addTime;/*** 最后一次登录时间*/Columnprivate Date lastLoginTime;/*** 最后一次登陆错误时间*/Column(name last_login_error_time,columnDefinitionDATETIME COMMENT 最后一次登陆错误时间)private Date lastLoginErrorTime;/*** 登陆错误计数*/Column(name login_rrror_count,columnDefinitionDATETIME COMMENT 登陆错误计数)private Integer loginErrorcount;/*** 是否锁定(0、未锁定1、锁定)*/Column(name is_locked,columnDefinitionDATETIME COMMENT 是否锁定)private Integer isLocked;// get/set方法此处省略}二、对应数据库三、登陆方法中进行判断验证out.print()打印的是前台接收的Json字符串/*** 检查登录是否正确并判断登录项目** throws IOException*/public void checkLogin() throws IOException {StatusPrinter.print(lc);HttpServletResponse response ServletActionContext.getResponse();response.setCharacterEncoding(DEFAULT_CHARACTER_UTF8);PrintWriter out response.getWriter();HttpSession session ServletActionContext.getRequest().getSession();// 得到系统保存的验证码String valiCode (String) session.getAttribute(rand);if (valiCode null) {out.print({\result\:\验证码失效请刷新页面后重试。\,\msg\:\系统错误刷新后重试。\}); // 刷新登录out.flush();out.close();return; // 返回结束;}// 如果验证码错误if (!valiCode.equals(rand)) {out.print(ActionResult.ErrMsg(验证码错误。)); // 刷新登录out.flush();out.close();return; // 返回结束;}UserInfo user userService.getUserByUserName(username);Date thisErrorLoginTime null;// 修改的本次登陆错误时间Integer islocked 0;// 获取是否锁定状态if (user null) {// 账号密码有问题out.print(ActionResult.ErrMsg(不存在此用户));} else if (user.getStatus()1) {out.print(ActionResult.ErrMsg(此用户已被删除));} else if (!user.getPassword().equals(MD5.getMD5(password.getBytes()))) {if (user.getIsLocked() null) {user.setIsLocked(0);} else {islocked user.getIsLocked();}if (user.getLoginErrorcount() null) {user.setLoginErrorcount(0);}Date date new Date();SimpleDateFormat format new SimpleDateFormat(yyyy-MM-dd HH:mm:ss);String datestr format.format(date);try {thisErrorLoginTime format.parse(datestr);} catch (ParseException e) {// TODO Auto-generated catch blocke.printStackTrace();}if (islocked 1) {// 账户被锁定 // 被锁定是登陆错误次数一定是5所以只判断一次Date lastLoginErrorTime null; // 最后一次登陆错误时间Long timeSlot 0L;if (user.getLastLoginErrorTime() null) {lastLoginErrorTime thisErrorLoginTime;} else {lastLoginErrorTime user.getLastLoginErrorTime();timeSlot thisErrorLoginTime.getTime() - lastLoginErrorTime.getTime();}if (timeSlot 1800000) {// 判断最后锁定时间,30分钟之内继续锁定out.print(ActionResult.ErrMsg(您的账户已被锁定请 (30-Math.ceil((double)timeSlot/60000)) 分钟之后再次尝试));} else {// 判断最后锁定时间,30分钟之后仍是错误继续锁定30分钟user.setLastLoginErrorTime(thisErrorLoginTime);userService.addUser(user);out.print(ActionResult.ErrMsg(账户或密码错误,您的账户已被锁定请30分钟之后再次尝试登陆));}} else if (user.getLoginErrorcount() 4) {// 账户第五次登陆失败 此时登陆错误次数增加至5以后错误仍是5不再递增user.setLoginErrorcount(5);user.setIsLocked(1);user.setLastLoginErrorTime(thisErrorLoginTime);userService.addUser(user);//修改用户out.print(ActionResult.ErrMsg(您的账户已被锁定请30分钟之后再次尝试登陆));} else {// 账户前四次登陆失败user.setLoginErrorcount(user.getLoginErrorcount() 1);user.setLastLoginErrorTime(thisErrorLoginTime);userService.addUser(user);//修改用户out.print(ActionResult.ErrMsg(账户或密码错误,您还有 (5-user.getLoginErrorcount()) 次登陆机会));}} else {islocked user.getIsLocked();if (islocked 1) {Date lastLoginErrorTime null; // 最后一次登陆错误时间Long timeSlot 0L;if (user.getLastLoginErrorTime() null) {lastLoginErrorTime new Date();} else {lastLoginErrorTime user.getLastLoginErrorTime();timeSlot new Date().getTime() - lastLoginErrorTime.getTime();}if (timeSlot 1800000) {// 判断最后锁定时间,30分钟之内继续锁定out.print(ActionResult.ErrMsg(您的账户已被锁定请 (30-Math.ceil((double)timeSlot/60000)) 分钟之后再次尝试));} else {// 判断最后锁定时间,30分钟之后登陆账户RoleInfo rroleService.getRoleById(user.getRoleId());if(r.getStatus()1){out.print({\result\:\该用户拥有的角色已被管理员删除请于管理员联系。\});}else{session.setAttribute(user, user);// 保存当前用户Date dnew Date();session.setAttribute(dateStr, d); // 保存当前用户登录时间用于显示user.setLoginErrorcount(0);user.setIsLocked(0);user.setLastLoginTime(user.getLoginTime());user.setLastLoginIp(user.getLoginIp());user.setLoginTime(d);user.setLoginIp(ServletActionContext.getRequest().getRemoteAddr());userService.addUser(user);//修改用户表登录时间// logService.addOperationLog(登录系统);log.info(登录系统);out.print(ActionResult.SUCCESS);}}} else {RoleInfo rroleService.getRoleById(user.getRoleId());if(r.getStatus()1){out.print({\result\:\该用户拥有的角色已被管理员删除请于管理员联系。\});}else{session.setAttribute(user, user);// 保存当前用户Date dnew Date();session.setAttribute(dateStr, d); // 保存当前用户登录时间用于显示user.setLoginErrorcount(0);user.setIsLocked(0);user.setLastLoginTime(user.getLoginTime());user.setLastLoginIp(user.getLoginIp());user.setLoginTime(d);user.setLoginIp(ServletActionContext.getRequest().getRemoteAddr());userService.addUser(user);//修改用户表登录时间// logService.addOperationLog(登录系统);log.info(登录系统);out.print(ActionResult.SUCCESS);}}}out.flush();out.close();}四、实现的逻辑
http://www.zqtcl.cn/news/366114/

相关文章:

  • 彩票网站开发 违法股票网站排名哪个好
  • 宝格丽网站建设哈尔滨网站建设王道下拉強
  • 烟台网站建设的公司世界500强企业排名2021
  • 网络营销做得比较成功的案例吴中seo网站优化软件
  • 怎么设立网站美区下载的app怎么更新
  • 建立网站ppt做酒店网站所用到的算法
  • 上海网站建设的价格低太仓做网站的公司
  • 怎样登录建设互联网站怎么做中英文网站
  • 云网站7china中小企业网站建设好么
  • 美丽南方官网网站建设国际新闻最新消息今天摘抄
  • 牛商网营销型网站多少钱江门营销型网站建设多少钱
  • 小榄公司网站建设网站交互做的比较好的
  • 深圳定制网站建设怎么改版网站
  • 免费学软件的自学网站江阴建设局网站
  • 网站做多久苍南县网站集约化建设
  • 深圳电子烟网站建设罗湖建设公司网站建设
  • 酒店 深圳 网站建设新项目首码对接平台
  • 岳阳市住房和城乡建设局网站上海专业网站建设网
  • 营销型网站建设设定包括哪些方面网站建设后的心得
  • 建立网站来网上销售的英文潢川城乡建设局网站
  • 仿站建站教程网站怎么接广告
  • 免费下载代码项目的网站长春网站建设找新生科技
  • 博兴县建设局网站做网站要用什么服务器吗
  • 成都中小企业网站建设公司怎么挑选网站建设公司
  • 万源网站建设在ppt里面做网站链接
  • 做网站时怎么添加动态信息中铁航空港建设集团网站
  • 文化礼堂建设情况网站网站建设运行
  • 自己做网站很难asp网站开发四酷全书:新闻_论坛_电子商城_博客
  • 网站建设入什么会计科目从网络安全角度考量请写出建设一个大型电影网站规划方案
  • 品牌建设+网站网站建设 淘宝客末班