mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-28 15:45:04 +08:00
use get method to submit ticket
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
package love.sola.netsupport.api;
|
||||
|
||||
/**
|
||||
* ***********************************************
|
||||
* Created by Sola on 2015/12/6.
|
||||
* Don't modify this source without my agreement
|
||||
* ***********************************************
|
||||
*/
|
||||
public class TicketCancel {
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import love.sola.netsupport.pojo.Ticket;
|
||||
import love.sola.netsupport.pojo.User;
|
||||
import love.sola.netsupport.sql.SQLCore;
|
||||
import love.sola.netsupport.util.JsonP;
|
||||
import love.sola.netsupport.util.Redirect;
|
||||
import love.sola.netsupport.wechat.Command;
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.Session;
|
||||
@@ -32,6 +31,10 @@ public class TicketSubmit extends HttpServlet {
|
||||
private Gson gson = SQLCore.gson;
|
||||
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
doGet(request, response);
|
||||
}
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
request.setCharacterEncoding("utf-8");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.addHeader("Content-type", "text/json;charset=utf-8");
|
||||
@@ -41,13 +44,6 @@ public class TicketSubmit extends HttpServlet {
|
||||
out.close();
|
||||
}
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
request.setCharacterEncoding("utf-8");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.addHeader("Content-type", "text/plain;charset=utf-8");
|
||||
Redirect.message(response, -1, "Illegal_Request");
|
||||
}
|
||||
|
||||
private Response submit(HttpServletRequest request) {
|
||||
try (Session s = SQLCore.sf.openSession()) {
|
||||
if (request.getSession() == null || request.getSession().getAttribute("authorized") != Command.SUBMIT) {
|
||||
|
||||
@@ -27,7 +27,7 @@ public enum Command {
|
||||
|
||||
static {
|
||||
for (Command type : values()) {
|
||||
if (type.id > 0) {
|
||||
if (type.id >= 0) {
|
||||
ID_MAP.put(type.id, type);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user