wenminjie
2026-08-03 ddc84625dcdb22a1ec2407f6adc7eb2e7a839ef0
talent-card-server/src/main/java/com/talentcard/server/business/admin/auth/AdminAuthService.java
@@ -80,11 +80,11 @@
    }
    @Transactional
    public void authenticate(String authorization) {
    public Long authenticate(String authorization) {
        String token = bearer(authorization);
        if (token.isBlank()) throw new BusinessException(ErrorCode.UNAUTHORIZED, "请先登录管理后台");
        List<Map<String, Object>> rows = rows("""
                select s.id session_id, o.status
                select s.id session_id, s.operator_id, o.status
                from admin_session s join admin_operator o on o.id = s.operator_id
                where s.access_token_hash = ? and s.revoked_at is null and s.access_expires_at > now()
                  and o.deleted = 0
@@ -95,6 +95,7 @@
            throw new BusinessException(ErrorCode.FORBIDDEN, "当前管理员账号已停用");
        }
        jdbc.update("update admin_session set last_used_at = now() where id = ?", number(rows.get(0).get("sessionId")));
        return number(rows.get(0).get("operatorId"));
    }
    private Map<String, Object> issueSession(Map<String, Object> operator) {