商品加入购买状态 商品详情加入水印

This commit is contained in:
litianxiang
2026-06-01 15:53:02 +08:00
parent 3ddf4051e3
commit afdb90e196
14 changed files with 190 additions and 34 deletions

View File

@@ -52,4 +52,15 @@ public class UserContext {
}
return holder.getId();
}
public static Long getBuyerIdSafely() {
AuthPrincipalVo holder = userHolder.get();
if (holder == null) {
return null;
}
if (!"BUYER".equals(holder.getSource())) {
return null;
}
return holder.getId();
}
}