fix(jd-collect): groups 端点会话身份直取——requireOwnershipUserId(httpRequest,null) 对管理角色豁免原样返 null ⇒ 作用域空、管理员账号客户端分类下拉全空(2026-11-20 用户实录,普通号不受影响);改 requireSessionOwnerUserId(JdPublishController 同款既有方法),判据测试改端点级断言+反向绊线(退回即红)。jdcat 窗完成件随联验恢复窗提交发版;DesktopHomePage.vue 属该窗在飞工作未动

This commit is contained in:
2026-11-20 02:05:28 +08:00
parent d69780cbc1
commit e903bc1845
2 changed files with 30 additions and 9 deletions
@@ -88,8 +88,13 @@ public class JdCollectController {
+ "(自己所属组的组长带的组)的分类,别组的一律不下发——这正是「不同组不能看到跨组的分类」。"
+ "只读不写——分类的增删改仍只在后管(本组管理员)。")
public ApiResponse<List<JdProductGroupVo>> groups(HttpServletRequest httpRequest) {
// 登录用户即可读:解析不出会话身份就 401(fail-closed,与建单同口径)。
Long userId = adminAuthSupport.requireOwnershipUserId(httpRequest, null);
// 会话身份直取(管理员也不例外):requireOwnershipUserId 走 bindOwnershipUserId,对管理角色
// 豁免时「原样返回请求值」——传 null 就拿回 null,resolveByUserId(null) 落空作用域,
// 平台超管/公司超管/管理员三类账号的客户端分类下拉全空(2026-11-20 用户实录:后管
// 京东数据库有分类、客户端「无数据」;普通号走 identity.getId() 不受影响,
// 2026-11-16「普通账户都能看到」口径验证时没暴露)。登录用户即可读,
// 解析不出会话身份仍 401(fail-closed)。
Long userId = adminAuthSupport.requireSessionOwnerUserId(httpRequest, null);
JdCategoryScopeService.JdCategoryScope scope = jdCategoryScopeService.resolveByUserId(userId);
return ApiResponse.success(jdProductGroupService.listForGroups(scope.visibleGroupIds()));
}