ElyPrism 598dd8bd34
refactor(unblock): Refactor song URL matching to use new utils package (#73)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-12-26 19:51:13 +08:00

94 lines
2.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>音乐解灰测试</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 20px auto;
padding: 0 20px;
}
.container {
background-color: #f5f5f5;
padding: 20px;
border-radius: 8px;
}
.form-group {
margin-bottom: 15px;
}
.source-options {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 15px;
}
.source-option {
display: flex;
align-items: center;
gap: 5px;
}
button {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
#result {
margin-top: 20px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
white-space: pre-wrap;
}
</style>
</head>
<body>
<div class="container">
<h1>音乐解灰测试</h1>
<div class="form-group">
<label for="songId">音乐 ID</label>
<input type="number" id="songId" placeholder="请输入音乐ID" required>
</div>
<div class="form-group">
<label for="sources">音源列表:</label>
<input type="text" id="sources" placeholder="请输入音源(非必填)">
</div>
<button onclick="testSong()">开始测试</button>
<div id="result"></div>
</div>
<script>
async function testSong() {
const songId = document.getElementById('songId').value;
if (!songId) {
alert('请输入音乐ID');
return;
}
const sources = document.getElementById('sources').value;
const resultDiv = document.getElementById('result');
resultDiv.textContent = '正在请求...';
try {
const response = await fetch(`/song/url/match?id=${songId}&source=${sources}`);
const data = await response.json();
resultDiv.textContent = JSON.stringify(data, null, 2);
} catch (error) {
resultDiv.textContent = `请求失败: ${error.message}`;
}
}
</script>
</body>
</html>