Files
api-client/src/utils/blessing.js
2026-06-01 06:35:41 +08:00

31 lines
841 B
Vue

/**
* 根据场景值获取场景名称
* @param {string} scene - 场景值
* @returns {string} - 场景名称
*/
const sceneMap = {
card_generate: '祝福卡片',
fortune_draw: '抽签',
wallpaper_download: '壁纸',
avatar_download: '头像',
card_generate_index: '祝福卡片分享首页',
fortune_draw_index: '抽签分享首页',
wallpaper_download_index: '壁纸分享首页',
avatar_download_index: '头像分享首页',
index: '分享首页',
mine: '我的页面分享',
}
export function getSceneName(scene) {
return sceneMap[scene] || scene
}
export const getThumbUrl = (url, w = 200, h = 200) => {
if (!url) return ''
if (url.startsWith('http')) {
return `${url}?imageView2/1/w/${w}/h/${h}/q/80`
} else {
return `https://file.lihailezzc.com/${url}?imageView2/1/w/${w}/h/${h}/q/80`
}
}