提交 6b3724e4 authored 作者: 吴德鹏's avatar 吴德鹏

优化评论

上级 73027637
......@@ -140,7 +140,7 @@ public class AddressController extends Controller {
System.out.println("address1:" + address);
repository.resetToDefaultAndAddressIdIsNot(user.getUserId(),addressId);
repository.resetToDefaultAndAddressIdIsNot(user.getUserId(), addressId);
address.setDefaultFlag(StateConstant.VALID);
TbCfAddress save = repository.save(address);
......@@ -159,6 +159,9 @@ public class AddressController extends Controller {
@GetMapping(value = "/default")
public Result getDefaultAddress() {
// TbCfAddress address = user.user().getAddress();
if (user.userId() == null) {
return new Result<>();
}
TbCfAddress address = repository.findFirstByUserIdAndDefaultFlag(user.userId(), StateConstant.VALID);
return new Result<>(address, address == null ? ResultCodeEnum.SERVICE_ERROR.getCode() : ResultCodeEnum.SUCCESS.getCode(), "");
}
......
......@@ -282,6 +282,9 @@ public class ItemController {
//
// }
String nick = c.getUserName();
String newNick = nick.substring(0, 1) + "***" + nick.substring(nick.length() - 1);
c.setUserName(newNick);
if (!StringUtils.isBlank(userId)) {
String liked = (String) redisCache.get(key + userId + "_" + c.getId());
c.setLike(liked == null ? false : true);
......
......@@ -71,7 +71,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
"/goodsType/**", "/home/**", "/spider/**", "/store/**", "/shopify/**", "/community/**", "/version/**",
"/flutterwave/notify/**", "/dpo/notify/**", "/advertisement/**", "/website/**", "/paypal/**", "/discover/bonus/**",
"/problem/**", "/cube/**", "/activity/**", "/attributes/**", "/stripe/**", "/coupon/**", "/logistics/freeShippingThreshold",
"/visit/**", "/search/**", "/country/**", "/term/**","/order/**","/api/upload").permitAll()
"/visit/**", "/search/**", "/country/**", "/term/**", "/order/**", "/api/upload", "/cart/**", "/address/**").permitAll()
.antMatchers("/api/test/**").permitAll()
.anyRequest().authenticated();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论