打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

用户:RedDragon/Test2:修订间差异

来自Rizline中文维基
第127行: 第127行:
         const encodedUrl = `https://rizwiki.cn/api.php?action=query%26titles=${encodeURIComponent(song.title)}%26prop=revisions%26rvprop=content%26format=json`
         const encodedUrl = `https://rizwiki.cn/api.php?action=query%26titles=${encodeURIComponent(song.title)}%26prop=revisions%26rvprop=content%26format=json`
         const decodedUrl = decodeURIComponent(encodedUrl)
         const decodedUrl = decodeURIComponent(encodedUrl)
        console.log('曲目图片文件名:', song.image) // 添加这行


         fetch(decodedUrl)
         fetch(decodedUrl)
第142行: 第140行:
                     const styles = parseStylesFromWikitext(wikitext)
                     const styles = parseStylesFromWikitext(wikitext)


                     const imageUrl = `https://rizwiki.cn/images/thumb/${song.image.substring(0, 1)}/${song.image.substring(0, 2)}/${song.image}/300px-${song.image}`
                     const imageUrl = parseImageFromWikitext(wikitext)
                     console.log('构造的图片URL:', imageUrl) // 添加这行
                     console.log('提取的图片URL:', imageUrl)


                     updateSongInfo(song, {
                     updateSongInfo(song, {
第159行: 第157行:
             .catch(e => {
             .catch(e => {
                 console.error('获取曲目颜色失败:', e)
                 console.error('获取曲目颜色失败:', e)
                const imageUrl = `https://rizwiki.cn/images/thumb/${song.image.substring(0, 1)}/${song.image.substring(0, 2)}/${song.image}/300px-${song.image}`
                console.log('错误时的图片URL:', imageUrl) // 添加这行
                 updateSongInfo(song, {
                 updateSongInfo(song, {
                     titleStyle: '#94E1FF',
                     titleStyle: '#94E1FF',
                     headerStyle: '#A3E5FF',
                     headerStyle: '#A3E5FF',
                     labelStyle: '#B2E9FE',
                     labelStyle: '#B2E9FE',
                     imageUrl: imageUrl,
                     imageUrl: null,
                     pageUrl: `https://rizwiki.cn/wiki/${encodeURIComponent(song.title)}`
                     pageUrl: `https://rizwiki.cn/wiki/${encodeURIComponent(song.title)}`
                 })
                 })
             })
             })
    }
    function parseImageFromWikitext(wikitext) {
        const fileMatch = wikitext.match(/\[\[文件:([^|\]]+)(?:\|[^]]*)?\]\]/)
        if (fileMatch) {
            const fileName = encodeURIComponent(fileMatch[1].trim())
            return `https://rizwiki.cn/wiki/文件:${fileName}`
        }
        return null
     }
     }



2025年10月20日 (一) 00:06的版本

曲目
限制
难度 a
流速 b
MOD c
其他 d

神秘的随机挑战!


曲目
限制
难度 a
流速 b
MOD c
其他 d

User:RedDragon/Test User:RedDragon/Test1 User:RedDragon/Test2