import {BlogMenuDB} from "~/server/services/blog/blogMenu";
import consola from "consola";

export default defineEventHandler(async event => {
  // 获取登录信息
  const headerAuth =  event.context.auth
  // 获取参数
  const body = await readBody(event)
  // 初始化DB
  body.id = event.context.getId()
  const blogMenuDB = new BlogMenuDB(event)
  const resd = await blogMenuDB.insertBlogMenu(body, headerAuth)
  consola.info(body, resd)
  const result = await blogMenuDB.getBlogMenuForBlogId(body.id, headerAuth)
  // if(!requAuth.isTrue) {
  //   // 判断为正常登录
  // }

  return result[0]
})
