新增:分享、下载图片、视频功能登
This commit is contained in:
@@ -64,8 +64,32 @@ const h5Url = (isCache = false) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
data(isCache)
|
||||
.then(setting => {
|
||||
const h5Url = setting[OTHER]['h5Url']
|
||||
resolve(h5Url)
|
||||
try {
|
||||
// 检查设置数据是否存在
|
||||
if (!setting || typeof setting !== 'object') {
|
||||
throw new Error('设置数据无效')
|
||||
}
|
||||
|
||||
// 检查 _other 字段是否存在
|
||||
if (!setting[OTHER] || typeof setting[OTHER] !== 'object') {
|
||||
throw new Error('_other 设置字段不存在')
|
||||
}
|
||||
|
||||
// 检查 h5Url 字段是否存在
|
||||
const h5UrlValue = setting[OTHER]['h5Url']
|
||||
if (!h5UrlValue || typeof h5UrlValue !== 'string' || h5UrlValue.trim() === '') {
|
||||
throw new Error('H5地址未配置或无效')
|
||||
}
|
||||
|
||||
resolve(h5UrlValue.trim())
|
||||
} catch (error) {
|
||||
console.error('获取H5地址失败:', error)
|
||||
reject(error)
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('获取设置数据失败:', err)
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user