getCookie 제거

This commit is contained in:
2026-01-10 21:59:11 +09:00
parent ef7914d5c6
commit 1b8cd8577e
30 changed files with 195 additions and 145 deletions

View File

@@ -1,7 +1,6 @@
import { query } from '../../utils/db'
import { callOpenAIVision, REPORT_PARSE_SYSTEM_PROMPT } from '../../utils/openai'
const ADMIN_EMAIL = 'coziny@gmail.com'
import { requireAdmin } from '../../utils/session'
interface ParsedTask {
description: string
@@ -37,18 +36,7 @@ interface ParsedResult {
*/
export default defineEventHandler(async (event) => {
// 관리자 권한 체크
const userId = getCookie(event, 'user_id')
if (!userId) {
throw createError({ statusCode: 401, message: '로그인이 필요합니다.' })
}
const currentUser = await query<any>(`
SELECT employee_email FROM wr_employee_info WHERE employee_id = $1
`, [userId])
if (!currentUser[0] || currentUser[0].employee_email !== ADMIN_EMAIL) {
throw createError({ statusCode: 403, message: '관리자만 사용할 수 있습니다.' })
}
await requireAdmin(event)
const body = await readBody<{ images: string[] }>(event)