fix: switch h5 assets to global interaction cos

This commit is contained in:
zhx 2026-07-08 19:46:39 +08:00
parent 5c26f868a1
commit 572c4cee1b
7 changed files with 14 additions and 11 deletions

View File

@ -119,7 +119,7 @@ const bgVapUrl = mp4Url('bg')
生成的线上地址形如:
```text
https://cdn.azizichat.com/h5/Azizi/Activities/ActiveGame/bg.mp4
https://asset.global-interaction.com/h5/Azizi/Activities/ActiveGame/bg.mp4
```
开发环境会走:
@ -199,7 +199,7 @@ await preloadVapConfig(resolveProtectedAssetUrl(bgVapUrl))
```js
const rewardVapUrl =
'https://cdn.azizichat.com/svgasource/manager-d824e59b-1a88-4d4f-aed3-01768ba20542.mp4'
'https://asset.global-interaction.com/svgasource/manager-d824e59b-1a88-4d4f-aed3-01768ba20542.mp4'
```
## 预加载建议
@ -283,4 +283,3 @@ await Promise.all([
- inline 不显示:确认父容器有 `position: relative/absolute` 和明确宽高。
- overlay 被遮挡:检查是否有更高的 z-index默认播放器弹层是 `3000`
- 背景遮挡内容检查页面层级ActiveGame 当前是页面背景 `z-index: 0`、VAP 背景 `z-index: 1`、页面内容 `z-index: 2`

View File

@ -145,7 +145,7 @@ npm run docs:sync:security
- host: `0.0.0.0`
- port: `5173`
- strictPort: `true`
- `/oss` 代理到 `https://cdn.azizichat.com`
- `/oss` 代理到 `https://asset.global-interaction.com`
- 预览服务:
- host: `0.0.0.0`
- port: `4173`
@ -520,7 +520,7 @@ Pinia 启用了 persisted state。
规则:
- 开发环境:`/oss/h5/Azizi/`
- 非开发环境:`https://cdn.azizichat.com/h5/Azizi/`
- 非开发环境:`https://asset.global-interaction.com/h5/Azizi/`
常用方法:

View File

@ -102,7 +102,7 @@ const shouldShowImage = computed(() => {
// const isOSSImage = computed(() => {
// return (
// props.imgUrl.startsWith('/oss/h5/Azizi/') ||
// props.imgUrl.startsWith('https://cdn.azizichat.com/h5/Azizi/')
// props.imgUrl.startsWith('https://asset.global-interaction.com/h5/Azizi/')
// )
// })

View File

@ -1,7 +1,9 @@
import { protectAssetUrl } from '@/utils/protectedAssets.js'
export const OSS_REMOTE_BASE_URL = 'https://asset.global-interaction.com/h5/Azizi/'
export const OSS_BASE_URL =
process.env.NODE_ENV === 'development' ? '/oss/h5/Azizi/' : 'https://cdn.azizichat.com/h5/Azizi/'
process.env.NODE_ENV === 'development' ? '/oss/h5/Azizi/' : OSS_REMOTE_BASE_URL
function buildAssetUrl(imagePath, filename, extension) {
return `${OSS_BASE_URL}${imagePath}${filename}.${extension}`

View File

@ -1,5 +1,6 @@
// src/utils/imageCacheManager.js
import { IMAGE_CACHE_VERSION } from '@/config/imageCacheVersion'
import { OSS_REMOTE_BASE_URL } from '@/config/imagePaths.js'
import { resolveProtectedAssetUrl } from '@/utils/protectedAssets.js'
import { useDebounce } from '@/utils/useDebounce'
@ -61,7 +62,7 @@ class ImageCacheManager {
let cacheName
if (
normalizedUrl.startsWith('https://cdn.azizichat.com/h5/Azizi/') ||
normalizedUrl.startsWith(OSS_REMOTE_BASE_URL) ||
normalizedUrl.includes('/oss/h5/Azizi/')
) {
cacheName = this.imageCacheName
@ -309,7 +310,7 @@ class ImageCacheManager {
const containsAssets = normalizedUrl.includes('/assets/')
const containsOssH5 = normalizedUrl.includes('/oss/h5/Azizi/')
const startsWithOss = normalizedUrl.startsWith('https://cdn.azizichat.com/h5/Azizi/')
const startsWithOss = normalizedUrl.startsWith(OSS_REMOTE_BASE_URL)
// 只缓存三种类型的资源
return containsAssets || containsOssH5 || startsWithOss

View File

@ -3,6 +3,7 @@ import { clearVapConfigCache, preloadVapConfig } from '@/utils/vapMp4Config.js'
import { resolveProtectedAssetUrl } from '@/utils/protectedAssets.js'
const REWARD_VAP_MAX_RETRY_COUNT = 3
const ASSET_ORIGIN = 'https://asset.global-interaction.com'
const isEmptySourceValue = (value) => {
if (typeof value !== 'string' && typeof value !== 'number') {
@ -77,7 +78,7 @@ export function useDailyRechargeRewardVap(options = {}) {
if (resolvedUrl.startsWith('/')) {
return process.env.NODE_ENV === 'development'
? `/oss${resolvedUrl}`
: `https://cdn.azizichat.com${resolvedUrl}`
: `${ASSET_ORIGIN}${resolvedUrl}`
}
return `https://${resolvedUrl}`

View File

@ -365,7 +365,7 @@ export default defineConfig(({ mode }) => {
cors: true,
proxy: {
'/oss': {
target: 'https://cdn.azizichat.com',
target: 'https://asset.global-interaction.com',
changeOrigin: true,
secure: true,
rewrite: (path) => path.replace(/^\/oss/, ''),