diff --git a/WebContent/admin/bookborrowlist.jsp b/WebContent/admin/bookborrowlist.jsp index 6c35f24..b04ad29 100644 --- a/WebContent/admin/bookborrowlist.jsp +++ b/WebContent/admin/bookborrowlist.jsp @@ -2,7 +2,7 @@ <%@page import="javabean.Base"%> <%@page import="java.sql.ResultSet"%> <%@page import="java.sql.PreparedStatement"%> -<%@page import="com.mysql.jdbc.Connection"%> +<%@page import="java.sql.Connection"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> diff --git a/WebContent/admin/booklist.jsp b/WebContent/admin/booklist.jsp index 2e0f7c4..c7eadf7 100644 --- a/WebContent/admin/booklist.jsp +++ b/WebContent/admin/booklist.jsp @@ -69,7 +69,7 @@ - + diff --git a/WebContent/admin/cardadd.jsp b/WebContent/admin/cardadd.jsp index 2d3ff0a..48f3f91 100644 --- a/WebContent/admin/cardadd.jsp +++ b/WebContent/admin/cardadd.jsp @@ -1,7 +1,7 @@ <%@page import="javabean.Base"%> <%@page import="java.sql.ResultSet"%> <%@page import="java.sql.PreparedStatement"%> -<%@page import="com.mysql.jdbc.Connection"%> +<%@page import="java.sql.Connection"%> <%@page import="net.sf.json.JSONObject"%> <%@page import="net.sf.json.JSONArray"%> <%@page import="javabean.Admin"%> diff --git a/WebContent/admin/cardedit.jsp b/WebContent/admin/cardedit.jsp index 57c9e5c..3fa82b0 100644 --- a/WebContent/admin/cardedit.jsp +++ b/WebContent/admin/cardedit.jsp @@ -1,7 +1,7 @@ <%@page import="javabean.Base"%> <%@page import="java.sql.ResultSet"%> <%@page import="java.sql.PreparedStatement"%> -<%@page import="com.mysql.jdbc.Connection"%> +<%@page import="java.sql.Connection"%> <%@page import="net.sf.json.JSONObject"%> <%@page import="net.sf.json.JSONArray"%> <%@page import="javabean.Admin"%> @@ -66,7 +66,7 @@
- placeholder="请输入密码" autocomplete="off" class="layui-input" lay-verify="required"> + placeholder="请输入密码" autocomplete="off" class="layui-input" lay-verify="required">
diff --git a/WebContent/admin/cardlist.jsp b/WebContent/admin/cardlist.jsp index 2d17ed2..926aafd 100644 --- a/WebContent/admin/cardlist.jsp +++ b/WebContent/admin/cardlist.jsp @@ -33,7 +33,7 @@ - + diff --git a/WebContent/admin/index.jsp b/WebContent/admin/index.jsp index 90d4c88..02b9910 100644 --- a/WebContent/admin/index.jsp +++ b/WebContent/admin/index.jsp @@ -28,11 +28,10 @@
  • - 贤心 + 系统管理员
    -
    基本资料
    -
    安全设置
    +
    修改密码
  • 注销
  • @@ -46,6 +45,9 @@
  • 书籍管理
  • +
  • + 书籍类型 +
  • 借阅证管理
  • @@ -64,14 +66,29 @@ + diff --git a/WebContent/admin/manageredit.jsp b/WebContent/admin/manageredit.jsp index e9201c0..c0d4811 100644 --- a/WebContent/admin/manageredit.jsp +++ b/WebContent/admin/manageredit.jsp @@ -1,6 +1,6 @@ <%@page import="java.sql.ResultSet"%> <%@page import="java.sql.PreparedStatement"%> -<%@page import="com.mysql.jdbc.Connection"%> +<%@page import="java.sql.Connection"%> <%@page import="javabean.Base"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> diff --git a/WebContent/admin/managerlist.jsp b/WebContent/admin/managerlist.jsp index 25093b0..154974f 100644 --- a/WebContent/admin/managerlist.jsp +++ b/WebContent/admin/managerlist.jsp @@ -39,8 +39,8 @@ ,height: 600 ,cols: [[ {field:'id', width:80, title: 'ID', sort: true} - ,{field:'name', width:80, title: '用户名'} ,{field:'account', width:80, title: '账号', sort: true} + ,{field:'name', width:80, title: '姓名'} ,{field:'email', title: '邮箱', minWidth: 150} ,{fixed: 'right', title:'操作', toolbar: '#operateBar', align: 'center', width:150} ]] diff --git a/WebContent/admin/ruleadd.jsp b/WebContent/admin/ruleadd.jsp index cc7f6e0..ce06807 100644 --- a/WebContent/admin/ruleadd.jsp +++ b/WebContent/admin/ruleadd.jsp @@ -5,7 +5,7 @@ <%@page import="java.util.ArrayList"%> <%@page import="java.sql.ResultSet"%> <%@page import="java.sql.PreparedStatement"%> -<%@page import="com.mysql.jdbc.Connection"%> +<%@page import="java.sql.Connection"%> <%@page import="javabean.Base"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> diff --git a/WebContent/admin/ruleedit.jsp b/WebContent/admin/ruleedit.jsp index 125ed1a..97b0f8d 100644 --- a/WebContent/admin/ruleedit.jsp +++ b/WebContent/admin/ruleedit.jsp @@ -5,7 +5,7 @@ <%@page import="java.util.ArrayList"%> <%@page import="java.sql.ResultSet"%> <%@page import="java.sql.PreparedStatement"%> -<%@page import="com.mysql.jdbc.Connection"%> +<%@page import="java.sql.Connection"%> <%@page import="javabean.Base"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> @@ -140,5 +140,9 @@ layui.use(['form', 'jquery'], function(){ }); + +<% + Base.closeResource(connection, pstmt, resultSet); +%> \ No newline at end of file diff --git a/WebContent/admin/sortadd.jsp b/WebContent/admin/sortadd.jsp new file mode 100644 index 0000000..bf98bd1 --- /dev/null +++ b/WebContent/admin/sortadd.jsp @@ -0,0 +1,79 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +分类添加 + + + + + + + +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    +
    + +
    +
    +
    + + + \ No newline at end of file diff --git a/WebContent/admin/sortedit.jsp b/WebContent/admin/sortedit.jsp new file mode 100644 index 0000000..2d041e0 --- /dev/null +++ b/WebContent/admin/sortedit.jsp @@ -0,0 +1,101 @@ +<%@page import="javabean.Base"%> +<%@page import="java.sql.ResultSet"%> +<%@page import="java.sql.PreparedStatement"%> +<%@page import="java.sql.Connection"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +分类编辑 + + + + + + +<% + String id = request.getParameter("id"); + Connection connection = null; + PreparedStatement pstmt = null; + ResultSet resultSet = null; + String sql = ""; + + connection = (Connection)Base.getConnection(); + sql = "select * from book_sort where id = ?"; + pstmt = connection.prepareStatement(sql); + pstmt.setString(1, id); + resultSet = pstmt.executeQuery(); + resultSet.next(); +%> + +
    + lay-verify="required" required autocomplete="off" class="layui-input layui-hide"> +
    + +
    + lay-verify="required" required autocomplete="off" placeholder="请输入分类名" class="layui-input"> +
    +
    + +
    + +
    + +
    +
    + +
    +
    + +
    +
    +
    + +<% + Base.closeResource(connection, pstmt, resultSet); +%> + + \ No newline at end of file diff --git a/WebContent/admin/sortlist.jsp b/WebContent/admin/sortlist.jsp new file mode 100644 index 0000000..66053be --- /dev/null +++ b/WebContent/admin/sortlist.jsp @@ -0,0 +1,108 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + 借阅卡 + + + + + + +
    + + + + + + + + + \ No newline at end of file diff --git a/WebContent/admin/updatePassword.jsp b/WebContent/admin/updatePassword.jsp new file mode 100644 index 0000000..6cab7d5 --- /dev/null +++ b/WebContent/admin/updatePassword.jsp @@ -0,0 +1,89 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +修改密码 + + + + + + + +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + + +
    +
    + +
    +
    +
    + + + \ No newline at end of file diff --git a/WebContent/WEB-INF/web.xml b/WebContent/web.xml similarity index 100% rename from WebContent/WEB-INF/web.xml rename to WebContent/web.xml diff --git a/build/classes/filter/AdminFilter.class b/build/classes/filter/AdminFilter.class index ed2913a..5262c53 100644 Binary files a/build/classes/filter/AdminFilter.class and b/build/classes/filter/AdminFilter.class differ diff --git a/build/classes/javabean/Admin.class b/build/classes/javabean/Admin.class index fc7433f..13f2d17 100644 Binary files a/build/classes/javabean/Admin.class and b/build/classes/javabean/Admin.class differ diff --git a/src/javabean/Admin.java b/src/javabean/Admin.java index d8a703e..a3f4ee8 100644 --- a/src/javabean/Admin.java +++ b/src/javabean/Admin.java @@ -35,7 +35,7 @@ public class Admin { connection = Base.getConnection(); pstmt = (PreparedStatement) connection.prepareStatement(sql); pstmt.setString(1, username); - pstmt.setString(2, password); + pstmt.setString(2, Util.passMd5(password)); resultSet = pstmt.executeQuery(); try{ if (resultSet.next()) { diff --git a/src/javabean/Util.java b/src/javabean/Util.java index 1c1a7cd..506256a 100644 --- a/src/javabean/Util.java +++ b/src/javabean/Util.java @@ -1,5 +1,8 @@ package javabean; +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.text.SimpleDateFormat; import net.sf.json.JSONObject; @@ -40,6 +43,9 @@ public class Util { return dateFormat.format(date); } + /* + * 返回json数据 + */ public static String jsonResponse(int code, String msg, String data) { JSONObject jsonObject = new JSONObject(); jsonObject.put("code", code); @@ -47,13 +53,36 @@ public class Util { if( data!=null ) { jsonObject.put("data", data); } - return jsonObject.toString(); } + /* + * md5加密 + */ + public static String stringToMD5(String plainText) { + byte[] secretBytes = null; + try { + secretBytes = MessageDigest.getInstance("md5").digest( + plainText.getBytes()); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException("没有这个md5算法!"); + } + String md5code = new BigInteger(1, secretBytes).toString(16); + for (int i = 0; i < 32 - md5code.length(); i++) { + md5code = "0" + md5code; + } + return md5code; + } + + public static String passMd5(String password) { + String salt = "ew!.E"; + return Util.stringToMD5(password +salt); + } + public static void main(String[] args) { - java.util.Date date = new java.util.Date(); - SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - System.out.println(dateFormat.format(date)); + System.out.println(Util.passMd5("admin")); + //java.util.Date date = new java.util.Date(); + //SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + //System.out.println(dateFormat.format(date)); } } diff --git a/src/servlet/admin/RuleAdd.java b/src/servlet/admin/RuleAdd.java index 4f78945..9ce3953 100644 --- a/src/servlet/admin/RuleAdd.java +++ b/src/servlet/admin/RuleAdd.java @@ -42,7 +42,6 @@ public class RuleAdd extends HttpServlet { int num = 0; try { Map libraryMap = Common.getLibraryMap(); - System.out.println(libraryMap); for(String key : libraryMap.keySet()) { if(req.getParameter("borrow_library[" +key +"]") != null) { if(num == 0) { diff --git a/src/servlet/admin/SortAdd.java b/src/servlet/admin/SortAdd.java new file mode 100644 index 0000000..027f724 --- /dev/null +++ b/src/servlet/admin/SortAdd.java @@ -0,0 +1,83 @@ +package servlet.admin; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import javabean.Base; +import javabean.Common; +import javabean.Util; + +@WebServlet("/admin/sortAdd") +public class SortAdd extends HttpServlet{ + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + resp.setContentType("application/json; charset=utf8"); + // 接受数据 + String name = req.getParameter("name"); + String description = req.getParameter("description"); + + // 准备数据 + Connection connection = null; + PreparedStatement pstmt = null; + ResultSet resultSet = null; + int result = 0; + String sql = ""; + int count = 0 ; + // 准备返回数据 + int code = 1; + String msg = ""; + + try { + connection = (Connection) Base.getConnection(); + // 查询重复name + sql = "select count(*) as count from book_sort where name=?"; + pstmt = connection.prepareStatement(sql); + pstmt.setString(1, name); + resultSet = pstmt.executeQuery(); + if(resultSet.next()) { + // 有重复 + if(resultSet.getInt("count") > 0) { + msg = "分类名不能重复"; + }else { + // 进行插入 + sql = "insert into book_sort(name, description) values(?,?)"; + pstmt = connection.prepareStatement(sql); + pstmt.setString(1, name); + pstmt.setString(2, description); + result = pstmt.executeUpdate(); + if(result == 1) { + code = 0; + msg = "添加成功"; + }else { + msg = "添加失败"; + } + } + } + + } catch (ClassNotFoundException e) { + msg = "classnotfound"; + } catch (SQLException e) { + msg = "SQL错误"; + } finally { + try { + Base.closeResource(connection, pstmt, resultSet); + } catch (SQLException e) { + msg = "关闭失败"; + } + } + + PrintWriter out = resp.getWriter(); + out.print(Util.jsonResponse(code, msg, null)); + + } +} diff --git a/src/servlet/admin/SortDel.java b/src/servlet/admin/SortDel.java new file mode 100644 index 0000000..e368b57 --- /dev/null +++ b/src/servlet/admin/SortDel.java @@ -0,0 +1,82 @@ +package servlet.admin; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import javabean.Base; +import javabean.Util; + + +@WebServlet("/admin/sortDel") +public class SortDel extends HttpServlet { + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + // !!!!! 默认1为未分类 + String defaultId = "1"; + resp.setContentType("application/json; charset=utf8"); + // 接受数据 + String id = req.getParameter("id"); + + // 准备数据 + Connection connection = null; + PreparedStatement pstmt = null; + ResultSet resultSet = null; + int result = 0; + String sql = ""; + + // 准备返回数据 + int code = 1; + String msg = ""; + try { + // 不能删除未分类 + if(defaultId.equals(id)) { + msg = "不能删除未分类"; + }else { + connection = (Connection) Base.getConnection(); + // 分类下的文章修改 + sql = "update books set sort_id=? where sort_id=?"; + pstmt = connection.prepareStatement(sql); + pstmt.setString(1, defaultId); + pstmt.setString(2, id); + result = pstmt.executeUpdate(); + + // 进行删除 + sql = "delete from book_sort where id=?"; + pstmt = connection.prepareStatement(sql); + pstmt.setString(1, id); + result = pstmt.executeUpdate(); + if(result == 1) { + code = 0; + msg = "删除成功"; + }else { + msg = "删除失败"; + } + } + + } catch (ClassNotFoundException e) { + msg = "classnotfound"; + } catch (SQLException e) { + msg = "SQL错误"; + } finally { + try { + Base.closeResource(connection, pstmt, resultSet); + } catch (SQLException e) { + msg = "关闭失败"; + } + } + + PrintWriter out = resp.getWriter(); + out.print(Util.jsonResponse(code, msg, null)); + } + +} diff --git a/src/servlet/admin/SortEdit.java b/src/servlet/admin/SortEdit.java new file mode 100644 index 0000000..36d90b1 --- /dev/null +++ b/src/servlet/admin/SortEdit.java @@ -0,0 +1,86 @@ +package servlet.admin; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import javabean.Base; +import javabean.Util; + + +@WebServlet("/admin/sortEdit") +public class SortEdit extends HttpServlet { + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + resp.setContentType("application/json; charset=utf8"); + // 接受数据 + String id = req.getParameter("id"); + String name = req.getParameter("name"); + String description = req.getParameter("description"); + + // 准备数据 + Connection connection = null; + PreparedStatement pstmt = null; + ResultSet resultSet = null; + int result = 0; + String sql = ""; + int count = 0 ; + // 准备返回数据 + int code = 1; + String msg = ""; + + try { + connection = (Connection) Base.getConnection(); + // 查询重复name + sql = "select count(*) as count from book_sort where name=? and id != ?"; + pstmt = connection.prepareStatement(sql); + pstmt.setString(1, name); + pstmt.setString(2, id); + resultSet = pstmt.executeQuery(); + if(resultSet.next()) { + // 有重复 + if(resultSet.getInt("count") > 0) { + msg = "分类名不能重复"; + }else { + // 进行插入 + sql = "update book_sort set name=?, description=? where id=?"; + pstmt = connection.prepareStatement(sql); + pstmt.setString(1, name); + pstmt.setString(2, description); + pstmt.setString(3, id); + result = pstmt.executeUpdate(); + if(result == 1) { + code = 0; + msg = "修改成功"; + }else { + msg = "修改失败"; + } + } + } + + } catch (ClassNotFoundException e) { + msg = "classnotfound"; + } catch (SQLException e) { + msg = "SQL错误"; + } finally { + try { + Base.closeResource(connection, pstmt, resultSet); + } catch (SQLException e) { + msg = "关闭失败"; + } + } + + PrintWriter out = resp.getWriter(); + out.print(Util.jsonResponse(code, msg, null)); + + } +} diff --git a/src/servlet/admin/SortList.java b/src/servlet/admin/SortList.java new file mode 100644 index 0000000..e0e014e --- /dev/null +++ b/src/servlet/admin/SortList.java @@ -0,0 +1,75 @@ +package servlet.admin; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import javabean.Base; +import javabean.Util; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + + +@WebServlet("/admin/sortList") +public class SortList extends HttpServlet { + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + resp.setContentType("application/json; charset:utf8"); + // 接受参数 + + // 准备参数 + Connection connection = null; + PreparedStatement pstmt = null; + ResultSet resultSet = null; + JSONObject jsonObject = new JSONObject(); + JSONArray jsonArray = new JSONArray(); + // 返回参数 + int code = 1; + String msg = "error"; + int count = 0; + String sql = ""; + PrintWriter out = resp.getWriter(); + // 开始查询 + try { + connection = Base.getConnection(); + sql = "select * from book_sort"; + pstmt = connection.prepareStatement(sql); + resultSet = pstmt.executeQuery(); + while(resultSet.next()) { + jsonObject.put("id", resultSet.getString("id")); + jsonObject.put("name", resultSet.getString("name")); + jsonObject.put("description", resultSet.getString("description")); + jsonArray.add(jsonObject.toString()); + } + if(!jsonArray.isEmpty()) { + code = 0; + msg = "查询成功"; + }else { + msg = "数据为空"; + } + } catch (ClassNotFoundException e) { + msg = "没找到"; + e.printStackTrace(); + } catch (SQLException e) { + msg = "sql错误"; + }finally { + try { + Base.closeResource(connection, pstmt, resultSet); + } catch (SQLException e) { + msg = "关闭失败"; + } + } + out.print( Util.jsonResponse(code, msg, jsonArray.toString()) ); + + } + +} diff --git a/src/servlet/admin/UpdatePassword.java b/src/servlet/admin/UpdatePassword.java new file mode 100644 index 0000000..ebd205c --- /dev/null +++ b/src/servlet/admin/UpdatePassword.java @@ -0,0 +1,98 @@ +package servlet.admin; + +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import javabean.Base; +import javabean.Util; +import net.sf.json.JSONObject; + + +@WebServlet("/admin/updatePassword") +public class UpdatePassword extends HttpServlet { + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + resp.setContentType("application/json; charset=utf8"); + // 接受数据 + String oldPassword = req.getParameter("oldPassword"); + String newPassword = req.getParameter("newPassword"); + String conPassword = req.getParameter("conPassword"); + HttpSession session = req.getSession(); + String username = (String) session.getAttribute("admin"); + + + // 准备资源 + Connection connection = null; + PreparedStatement pstmt = null; + ResultSet resultSet = null; + int result = 0; + String sql = null; + int count = 0; + // 返回数据 + int code = 1; + String msg = "error"; + JSONObject json = new JSONObject(); + PrintWriter out = resp.getWriter(); + + // 可靠性 + if(conPassword.equals(newPassword)) { + // 查询 + try { + connection = Base.getConnection(); + // 验证账号密码 + sql = "select count(*) as count from admin where username=? and password=?"; + pstmt = connection.prepareStatement(sql); + pstmt.setString(1, username); + pstmt.setString(2, Util.passMd5(oldPassword)); + resultSet = pstmt.executeQuery(); + while(resultSet.next()) { + count = resultSet.getInt("count"); + } + // 修改密码 + // 密码正确 + if(count >= 1) { + sql = "update admin set password=? where username=?"; + pstmt = connection.prepareStatement(sql); + pstmt.setString(1, Util.passMd5(newPassword)); + pstmt.setString(2, username); + result = pstmt.executeUpdate(); + if(result == 1) { + code = 0; + msg = "修改成功"; + }else { + msg = "修改失败"; + } + + }else { + msg = "密码错误"; + } + } catch (ClassNotFoundException e) { + msg = "class notfound"; + } catch (SQLException e) { + msg = "sql错误"; + } finally { + try { + Base.closeResource(connection, pstmt, resultSet); + } catch (SQLException e) { + msg = "关闭失败"; + } + } + + }else { + msg = "两次密码不一致"; + } + out.print(Util.jsonResponse(code, msg, null)); + } + +}