topfans/frontend/utils/h5OssPostUrl.js
2026-06-24 16:30:00 +08:00

17 lines
713 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* H5 OSS PostObject 直传 URL 解析
*
* 项目为 uni-app 移动端,本就走 OSS 直传(uni.uploadFile / fetch 直连 OSS 桶)。
* 原 dev 模式下的 /dev-oss-proxy Vite 中间件转发方案已废弃(无 vite.config.js),
* 统一在 OSS 桶侧配 CORS 放行 POST 即可(Origin=*, Method=GET/HEAD/POST, Header=*)。
*
* 保留本文件作为单一改写入口,后续如需按环境切换 URL 在这里集中处理。
*
* @param {string} ossHost 签名接口返回的 host如 https://bucket.oss-cn-shanghai.aliyuncs.com
* @returns {string} 实际用于 POST 的 URL(目前恒等于 ossHost)
*/
export function resolveH5OssPostUrl(ossHost) {
if (!ossHost) return ossHost
return ossHost
}