提交正式官网
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { getRequestURL, type H3Event } from 'h3'
|
||||
import { resolveSiteUrl } from '~/utils/seo'
|
||||
|
||||
/** 反向代理后读取真实域名(支持 umedglobal.cn / umedglobal.com.cn 等多域名) */
|
||||
export const REQUEST_SITE_URL_OPTS = {
|
||||
xForwardedHost: true,
|
||||
xForwardedProto: true
|
||||
} as const
|
||||
|
||||
export function getSiteUrlFromEvent(event: H3Event, fallback: string) {
|
||||
return resolveSiteUrl(fallback, getRequestURL(event, REQUEST_SITE_URL_OPTS).origin)
|
||||
}
|
||||
Reference in New Issue
Block a user