update settle controller

This commit is contained in:
2019-09-03 20:04:24 +08:00
parent 9bfd0e170c
commit a1bd10307a
3 changed files with 13 additions and 3 deletions
@@ -36,6 +36,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers(HttpMethod.POST, "/product/**").hasAnyAuthority("ADMIN", "SHOPKEEPER")
.antMatchers(HttpMethod.DELETE, "/product/**").hasAnyAuthority("ADMIN", "SHOPKEEPER")
.antMatchers("/cart").hasAnyAuthority("CUSTOMER", "ADMIN")
.antMatchers("/settle/**").hasAnyAuthority("ADMIN", "CUSTOMER", "SHOPKEEPER")
.antMatchers("/home/**").hasAnyAuthority("ADMIN", "SHOPKEEPER", "CUSTOMER")
.antMatchers("/admin/**").hasAuthority("ADMIN")
.and().formLogin().loginPage("/login").usernameParameter("username").passwordParameter("password");
@@ -30,7 +30,7 @@ public class SettleController {
for (var cartID : shoppingCartItems) {
System.out.println(cartID);
}
model.addAttribute("shippingAddrList", user.getShippingAddrAddrList());
return "settle.html";
}
+11 -2
View File
@@ -1,10 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>结算</title>
</head>
<body>
<ul>
<!--/*@thymesVar id="shippingAddrList" type="java.util.Set<edu.neu.neumall.entity.ShippingAddr>"*/-->
<li th:each="addr:${shippingAddrList}">
<span th:text="${addr.getReceiverProvince()}"></span>
<span th:text="${addr.getReceiverCity()}"></span>
<span th:text="${addr.getReceiverDistrict()}"></span>
<span th:text="${addr.getReceiverPhone()}"></span>
<span th:text="${addr.getReceiverName()}"></span>
</li>
</ul>
</body>
</html>