aerwen_web_nuxt/server/api/news/getinfoArticleInfo.js
2023-06-30 10:50:43 +08:00

24 lines
604 B
JavaScript

import {
readRawBody,
getQuery,
getMethod
} from 'h3'
/**
* 获取新闻详情
*/
export default defineEventHandler(async (event) => {
// 基础url
const baseURL = process.env.NUXT_PROXY_WEB_API
const method = getMethod(event).toUpperCase()
let body
if (method !== 'GET') body = await readRawBody(event)
const res = await $fetch(baseURL + "/ExaminationInformation.InfoArticle/getinfoArticleInfo", {
method,
baseURL: event.context.baseUrl,
headers: event.context.headers,
params: getQuery(event),
body
})
return res
})