feat(sep): add service of letter vclaim

This commit is contained in:
riefive
2025-10-28 11:13:39 +07:00
parent 2239b94632
commit f0ab15cadf
8 changed files with 72 additions and 7 deletions
+4 -1
View File
@@ -1,4 +1,3 @@
import { is } from 'date-fns/locale'
import { defineEventHandler, getCookie, getRequestHeaders, getRequestURL, readBody } from 'h3'
export default defineEventHandler(async (event) => {
@@ -9,6 +8,7 @@ export default defineEventHandler(async (event) => {
const apiOrigin = config.public.API_ORIGIN
const apiVclaim = config.public.VCLAIM
const apiVclaimSwagger = config.public.VCLAIM_SWAGGER
const pathname = url.pathname.replace(/^\/api/, '')
const isVclaim = pathname.includes('/vclaim')
@@ -16,6 +16,9 @@ export default defineEventHandler(async (event) => {
if (pathname.includes('/vclaim')) {
targetUrl = apiVclaim + pathname.replace('/vclaim', '') + (url.search || '')
}
if (pathname.includes('/vclaim-swagger')) {
targetUrl = apiVclaimSwagger + pathname.replace('/vclaim-swagger', '') + (url.search || '')
}
const verificationId = headers['verification-id'] as string | undefined
let bearer = ''