修复了商家客服登录身份标识问题

This commit is contained in:
XingQue
2026-06-20 03:36:58 +08:00
parent 92704a86ca
commit 1d4d054c75
2 changed files with 14 additions and 1 deletions

View File

@@ -53,6 +53,15 @@ def assert_staff_perm(member, perm_code):
raise StaffAuthError(403, f'无权限: {perm_code}')
def staff_fields_for_login(user):
"""登录/注册响应附带子客服身份(与 shangjiastatus 并列,互斥)。"""
ctx = resolve_staff_context(user)
return {
'staffstatus': 1 if ctx else 0,
'staff_context': ctx,
}
def resolve_staff_context(user):
"""子客服上下文;非客服返回 None。"""
member = get_active_staff_member(user)