diff --git a/src/main/java/com/tl/hamburger/controller/AdminController.java b/src/main/java/com/tl/hamburger/controller/AdminController.java
index 39752e01e479063acaca0fce6255093822549f89..fb27ad2b971d4da9d0ba221760f1bab436c4195a 100644
--- a/src/main/java/com/tl/hamburger/controller/AdminController.java
+++ b/src/main/java/com/tl/hamburger/controller/AdminController.java
@@ -61,6 +61,21 @@ public class AdminController {
}
}
+ @PostMapping("reset")
+ public JsonResult> reset(@RequestBody Admin admin) {
+ Admin service = adminService.getByAdminName(admin.getAdminName());
+ if (service == null) {
+ return ResultTool.fail("用户不存在");
+ }
+ service.setAdminPassword(admin.getAdminPassword());
+ int update = adminService.update(service);
+ if (update > 0) {
+ return ResultTool.success("修改成功", null);
+ } else {
+ return ResultTool.fail("修改失败");
+ }
+ }
+
@GetMapping("")
public JsonResult> getAdmin(HttpServletRequest request) {
HttpSession session = request.getSession();
diff --git a/src/main/java/com/tl/hamburger/controller/ClerkController.java b/src/main/java/com/tl/hamburger/controller/ClerkController.java
index 165742c51934594d8a013448d9e65d87b7981274..dfced68f78538bcf19bfd3ca3370e0f3157f579b 100644
--- a/src/main/java/com/tl/hamburger/controller/ClerkController.java
+++ b/src/main/java/com/tl/hamburger/controller/ClerkController.java
@@ -117,6 +117,21 @@ public class ClerkController {
}
}
+ @PostMapping("reset")
+ public JsonResult> reset(@RequestBody Clerk clerk) {
+ Clerk service = clerkService.getByUsername(clerk.getUsername());
+ if (service == null) {
+ return ResultTool.fail("用户不存在");
+ }
+ service.setPassword(clerk.getPassword());
+ int update = clerkService.update(service);
+ if (update > 0) {
+ return ResultTool.success("修改成功", null);
+ } else {
+ return ResultTool.fail("修改失败");
+ }
+ }
+
@DeleteMapping("{id}")
public JsonResult> delete(@PathVariable Integer id) {
int delete = clerkService.delete(id);
diff --git a/src/main/webapp/addClerk.html b/src/main/webapp/addClerk.jsp
similarity index 98%
rename from src/main/webapp/addClerk.html
rename to src/main/webapp/addClerk.jsp
index c97ae11f9084f685091afe135f96b7204b12eb00..ac8a4cde80560393ff69e22fa5c256295ffce1b6 100644
--- a/src/main/webapp/addClerk.html
+++ b/src/main/webapp/addClerk.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
diff --git a/src/main/webapp/addProduct.html b/src/main/webapp/addProduct.jsp
similarity index 98%
rename from src/main/webapp/addProduct.html
rename to src/main/webapp/addProduct.jsp
index 78de6242215fe2cacd908cb5e96e4b9b6e0b7b14..18e9d794ef744d6de3527261ea7ec59d2294d409 100644
--- a/src/main/webapp/addProduct.html
+++ b/src/main/webapp/addProduct.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
diff --git a/src/main/webapp/admin.html b/src/main/webapp/admin.jsp
similarity index 85%
rename from src/main/webapp/admin.html
rename to src/main/webapp/admin.jsp
index 691b6c7c9c05f236e3a22fb18269d3220018bbdf..22b209c33229d9527688709d02b2274579dbadbb 100644
--- a/src/main/webapp/admin.html
+++ b/src/main/webapp/admin.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
@@ -20,7 +21,7 @@
-
- 修改密码
+ 修改密码
- 注销
@@ -33,13 +34,13 @@
@@ -47,7 +48,7 @@
@@ -80,7 +81,7 @@
},
methods: {
index() {
- window.location.href = "./index.html";
+ window.location.href = "index.jsp";
},
logout() {
axios.post('./admin/logout').then(response => {
diff --git a/src/main/webapp/clerk.html b/src/main/webapp/clerk.jsp
similarity index 86%
rename from src/main/webapp/clerk.html
rename to src/main/webapp/clerk.jsp
index 885211d1d85ccc2083e3c4711fa91ce3b6b25a24..d5b4366b6c62294ad88eb4d0d04fee0575f6b1d2 100644
--- a/src/main/webapp/clerk.html
+++ b/src/main/webapp/clerk.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
@@ -19,10 +20,10 @@
-
- 修改密码
+ 修改密码
-
- 修改信息
+ 修改信息
- 注销
@@ -35,10 +36,10 @@
@@ -47,7 +48,7 @@
@@ -78,7 +79,7 @@
},
methods: {
index() {
- window.location.href = "./index.html";
+ window.location.href = "index.jsp";
},
logout() {
axios.post('./clerk/logout').then(response => {
diff --git a/src/main/webapp/clerkInfo.html b/src/main/webapp/clerkInfo.jsp
similarity index 98%
rename from src/main/webapp/clerkInfo.html
rename to src/main/webapp/clerkInfo.jsp
index ec55dc6ebcdfbfef3c729354918c50e0b0264f83..b2b49e2a3095dc6cf1bd5227baec31ff1be4b022 100644
--- a/src/main/webapp/clerkInfo.html
+++ b/src/main/webapp/clerkInfo.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
@@ -98,7 +99,7 @@
layer.open({
type: 2,
title: '店员更新',
- content: "updateClerk.html?id=" + obj.data.id,
+ content: "updateClerk.jsp?id=" + obj.data.id,
area: ["500px", "400px"]
});
} else if (obj.event === 'delete') {
diff --git a/src/main/webapp/index.html b/src/main/webapp/index.jsp
similarity index 97%
rename from src/main/webapp/index.html
rename to src/main/webapp/index.jsp
index 3acf4dbb608ffad447a6e76d5e1882868fe438dc..50881918dcfd68f1b2d0e97e6bf0835ea4959b8e 100644
--- a/src/main/webapp/index.html
+++ b/src/main/webapp/index.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
@@ -48,7 +49,7 @@
v-model="loginIdentity"/>店员
- 忘记密码?
+ 忘记密码?
@@ -83,10 +84,10 @@
},
methods: {
admin() {
- window.location.href = "./admin.html";
+ window.location.href = "admin.jsp";
},
clerk() {
- window.location.href = "./clerk.html";
+ window.location.href = "clerk.jsp";
},
login() {
if (this.loginUser === '' || this.loginPassword === '') {
diff --git a/src/main/webapp/order.html b/src/main/webapp/order.jsp
similarity index 96%
rename from src/main/webapp/order.html
rename to src/main/webapp/order.jsp
index 6cd316614ed3093d4dd8c0a267e213f58822f28d..cfeae70fe3a6accc75537c117fbad17ddbb7177c 100644
--- a/src/main/webapp/order.html
+++ b/src/main/webapp/order.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
@@ -74,7 +75,7 @@
layer.open({
type: 2,
title: '订单详情',
- content: "orderInfo.html?id=" + obj.data.id,
+ content: "orderInfo.jsp?id=" + obj.data.id,
area: ["700px", "500px"]
});
} else {
diff --git a/src/main/webapp/orderInfo.html b/src/main/webapp/orderInfo.jsp
similarity index 97%
rename from src/main/webapp/orderInfo.html
rename to src/main/webapp/orderInfo.jsp
index bec09ec51ab430f7d104c327d1ca65a627923192..cf7f0af62efe653d7fffb057b12115c632f2c7a2 100644
--- a/src/main/webapp/orderInfo.html
+++ b/src/main/webapp/orderInfo.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
diff --git a/src/main/webapp/product.html b/src/main/webapp/product.jsp
similarity index 98%
rename from src/main/webapp/product.html
rename to src/main/webapp/product.jsp
index 8d866b213ccb22ba01261409670e088c98b25384..f7ba1b1fcc4c7e847454c14f057a4da3a473927a 100644
--- a/src/main/webapp/product.html
+++ b/src/main/webapp/product.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
@@ -102,7 +103,7 @@
layer.open({
type: 2,
title: '商品更新',
- content: "updateProduct.html?id=" + obj.data.id,
+ content: "updateProduct.jsp?id=" + obj.data.id,
area: ["500px", "400px"]
});
} else if (obj.event === 'delete') {
diff --git a/src/main/webapp/reset.html b/src/main/webapp/reset.html
deleted file mode 100644
index 4b6b4f4435cc577408ca8631ba937912cef9f09a..0000000000000000000000000000000000000000
--- a/src/main/webapp/reset.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
- 汉堡包商店
-
-
-
-
-
-
-
-
diff --git a/src/main/webapp/reset.jsp b/src/main/webapp/reset.jsp
new file mode 100644
index 0000000000000000000000000000000000000000..c2d980a9b905fc929eefb1d0cb41ab7dc1d11983
--- /dev/null
+++ b/src/main/webapp/reset.jsp
@@ -0,0 +1,85 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+
+
+
+ 汉堡包商店
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/shop.html b/src/main/webapp/shop.jsp
similarity index 99%
rename from src/main/webapp/shop.html
rename to src/main/webapp/shop.jsp
index 7b3c2a58aeade68c73d2f5023806bdfdbd67bd99..2db66feea69d0bf62bae80630c6542f96cc39fee 100644
--- a/src/main/webapp/shop.html
+++ b/src/main/webapp/shop.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
diff --git a/src/main/webapp/updateClerk.html b/src/main/webapp/updateClerk.jsp
similarity index 98%
rename from src/main/webapp/updateClerk.html
rename to src/main/webapp/updateClerk.jsp
index 1c9c10f4d4617397e46e8ee4961bdfdff2533784..67148a150ee0aba0fdd05b000652e7a024134f1e 100644
--- a/src/main/webapp/updateClerk.html
+++ b/src/main/webapp/updateClerk.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
diff --git a/src/main/webapp/updateInfo.html b/src/main/webapp/updateInfo.jsp
similarity index 98%
rename from src/main/webapp/updateInfo.html
rename to src/main/webapp/updateInfo.jsp
index 716a10054bd9e3a64b5b422aa999e4a41d919492..559ff9628b56f4ac560241af4ba34683a65c055b 100644
--- a/src/main/webapp/updateInfo.html
+++ b/src/main/webapp/updateInfo.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
diff --git a/src/main/webapp/updatePassword.html b/src/main/webapp/updatePassword.jsp
similarity index 99%
rename from src/main/webapp/updatePassword.html
rename to src/main/webapp/updatePassword.jsp
index 3726d2724a2ffc48e0005bb4dd8779758972e13b..27e548a31a496e5a27da64d20a67c85c4d093d35 100644
--- a/src/main/webapp/updatePassword.html
+++ b/src/main/webapp/updatePassword.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
diff --git a/src/main/webapp/updateProduct.html b/src/main/webapp/updateProduct.jsp
similarity index 98%
rename from src/main/webapp/updateProduct.html
rename to src/main/webapp/updateProduct.jsp
index b49da74a2a0b3a8c7dc95842843734aa690054d5..e79f27d19430a5e2a27e5cb00d43533259b49641 100644
--- a/src/main/webapp/updateProduct.html
+++ b/src/main/webapp/updateProduct.jsp
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>