修正多处问题,添加骨架屏
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// 缓存相关常量
|
||||
// 缓存相关常量
|
||||
const CACHE_PREFIX = 'API_CACHE_'
|
||||
const CACHE_EXPIRE_TIME = 5 * 60 * 1000 // 默认缓存时间5分钟
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
// const BASE_URL = '/api'
|
||||
// const BASE_URL = '/api'
|
||||
// const BASE_URL = 'http://192.168.5.15:8084/api'
|
||||
const BASE_URL = 'https://www.gymmanage.xyz/api'
|
||||
|
||||
// OSS 静态资源基础地址
|
||||
export const OSS_BASE_URL = 'https://gymfuture.oss-cn-chengdu.aliyuncs.com'
|
||||
// OSS 静态资源基础地址(图标、通用静态文件)
|
||||
export const OSS_BASE_URL = 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/'
|
||||
|
||||
// 团课封面图片专用 OSS 地址
|
||||
export const COVER_BASE_URL = 'https://ycc-filesaver.oss-cn-beijing.aliyuncs.com/'
|
||||
|
||||
/**
|
||||
* 获取 OSS 资源完整地址
|
||||
* 获取 OSS 静态资源完整地址(图标等)
|
||||
* @param {string} path - OSS 资源路径,如 '/static/images/camera.png'
|
||||
* @returns {string} 完整 OSS 地址
|
||||
*/
|
||||
@@ -18,6 +21,25 @@ export const getOssUrl = (path) => {
|
||||
return OSS_BASE_URL + path
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取团课封面图片完整地址
|
||||
* @param {string} path - 封面资源路径
|
||||
* @returns {string} 完整封面地址
|
||||
*/
|
||||
export const getCourseCoverUrl = (path) => {
|
||||
if (!path) {
|
||||
console.warn('[getCourseCoverUrl] 入参为空')
|
||||
return ''
|
||||
}
|
||||
if (path.startsWith('http://') || path.startsWith('https://')) {
|
||||
console.log('[getCourseCoverUrl] 已是完整URL,直接返回:', path)
|
||||
return path
|
||||
}
|
||||
const fullUrl = COVER_BASE_URL + path
|
||||
console.log('[getCourseCoverUrl] OSS Key 拼接:', { 'path': path, 'COVER_BASE_URL': COVER_BASE_URL, '结果': fullUrl })
|
||||
return fullUrl
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录会员ID
|
||||
* @returns {number|null} 会员ID,未登录返回null
|
||||
|
||||
Reference in New Issue
Block a user