import { sleep } from '@/utils/common' export const randomImageUrl = { ycy: 'https://t.alcy.cc/ycy', pc: 'https://t.alcy.cc/pc', moemp: 'https://t.alcy.cc/moemp', picsum: 'https://picsum.photos/800/600', bing: 'https://bing.img.run/rand_uhd.php', xsot: 'https://api.xsot.cn/bing?jump=true', } type randomUrlKeys = keyof typeof randomImageUrl export const randomVideosUrl = { acg: 'https://t.alcy.cc/acg', } export function getPicSumImages(width: number = 800, height?: number) { const t = `${Date.now()}+${Math.random()}` if (!height) { return `https://picsum.photos/${width}?t=${t}` } return `https://picsum.photos/${width}/${height}?t=${t}` } /** * 获取随机图片URL * @param type 图片类型 默认pc * @returns 随机图片URL */ export function getRandomUrl(type?: randomUrlKeys) { return `${randomImageUrl[type || 'pc' as randomUrlKeys]}?t=${Date.now()}+${Math.random()}` }