初始化
This commit is contained in:
@@ -8,11 +8,11 @@ function joinURL(base: string, path: string) {
|
||||
|
||||
/**
|
||||
* 公开 CMS 接口代理
|
||||
* 将 /api/cms/* 代理到 mp-api,无需登录(不要求 Authorization)
|
||||
* 将 /api/cms/* 代理到 cms-api,无需登录(不要求 Authorization)
|
||||
*/
|
||||
export default defineEventHandler((event) => {
|
||||
const config = useRuntimeConfig()
|
||||
const mpApiBase = config.public.mpApiBase || 'https://mp-api.websoft.top'
|
||||
const mpApiBase = config.public.mpApiBase || 'https://cms-api.websoft.top'
|
||||
const path = getRouterParam(event, 'path') || ''
|
||||
const search = getRequestURL(event).search
|
||||
const target = joinURL(mpApiBase + '/api/cms', path) + search
|
||||
|
||||
@@ -6,7 +6,7 @@ export default defineEventHandler(async (event) => {
|
||||
const config = useRuntimeConfig()
|
||||
const query = getQuery(event)
|
||||
const modulesApiBase =
|
||||
config.public.modulesApiBase || config.public.ApiBase || 'https://websopy-api.websoft.top/api'
|
||||
config.public.modulesApiBase || config.public.ApiBase || 'https://cms-api.websoft.top/api'
|
||||
|
||||
const tenantId =
|
||||
getHeader(event, 'tenantid') ||
|
||||
|
||||
@@ -6,7 +6,7 @@ export default defineEventHandler(async (event) => {
|
||||
const config = useRuntimeConfig()
|
||||
const query = getQuery(event)
|
||||
const modulesApiBase =
|
||||
config.public.modulesApiBase || config.public.ApiBase || 'https://websopy-api.websoft.top/api'
|
||||
config.public.modulesApiBase || config.public.ApiBase || 'https://cms-api.websoft.top/api'
|
||||
|
||||
const tenantId =
|
||||
getHeader(event, 'tenantid') ||
|
||||
|
||||
Reference in New Issue
Block a user