xxjb_changePassword.jsp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <%@page import="java.util.Map"%>
  2. <%@page import="org.json.JSONObject"%>
  3. <%@page import="com.ccgj.platform.admin.USERAction"%>
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <%@taglib uri="/struts-tags" prefix="s"%>
  6. <%@ page pageEncoding="utf-8"%>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <%
  11. String path = request.getContextPath();
  12. String basePath = request.getScheme() + "://"
  13. + request.getServerName() + ":" + request.getServerPort()
  14. + path + "/";
  15. String username=request.getParameter("username").trim();
  16. String ypwd=request.getParameter("ypwd");
  17. String newpwd=request.getParameter("newpwd");
  18. String qrpwd=request.getParameter("qrpwd");
  19. String id=request.getParameter("id");
  20. String userid=request.getParameter("userid");
  21. USERAction ua=new USERAction();
  22. Map <String,String>m=ua.login(username,ypwd);
  23. if(m.get("success").equals("true")){
  24. //修改密码
  25. boolean boo=ua.changePassword(newpwd, userid);
  26. if(boo){
  27. %>
  28. <script>
  29. alert("修改成功!");
  30. <%
  31. session.removeAttribute("username");
  32. session.removeAttribute("userpwd");
  33. session.removeAttribute("userfullname");
  34. session.removeAttribute("userid");
  35. %>
  36. window.location.href="<%=basePath%>main/<%=id%>_0/news_xxjb.html";
  37. </script>
  38. <%}else{ %>
  39. <script>
  40. alert("网络繁忙,密码修改失败,请稍后重试");
  41. history.go(-1);
  42. </script>
  43. <%}
  44. }else{
  45. %>
  46. <script>
  47. alert("密码错误,请重新输入");
  48. history.go(-1);
  49. </script>
  50. <%
  51. }
  52. %>
  53. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  54. <title>长春经济技术开发区内网</title>
  55. </head>
  56. <body>
  57. </body>
  58. </html>