40 lines
1.3 KiB
HTML
40 lines
1.3 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<meta charset="UTF-8">
|
||
|
|
<title>测试 Lover API</title>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<h1>Lover API 测试</h1>
|
||
|
|
<button onclick="testBasic()">测试 /lover/basic</button>
|
||
|
|
<button onclick="testConfig()">测试 /lover/config</button>
|
||
|
|
<pre id="result"></pre>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
async function testBasic() {
|
||
|
|
try {
|
||
|
|
const response = await fetch('http://127.0.0.1:8000/lover/basic', {
|
||
|
|
credentials: 'include'
|
||
|
|
});
|
||
|
|
const data = await response.json();
|
||
|
|
document.getElementById('result').textContent = JSON.stringify(data, null, 2);
|
||
|
|
} catch (error) {
|
||
|
|
document.getElementById('result').textContent = 'Error: ' + error.message;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
async function testConfig() {
|
||
|
|
try {
|
||
|
|
const response = await fetch('http://127.0.0.1:8000/lover/config', {
|
||
|
|
credentials: 'include'
|
||
|
|
});
|
||
|
|
const data = await response.json();
|
||
|
|
document.getElementById('result').textContent = JSON.stringify(data, null, 2);
|
||
|
|
} catch (error) {
|
||
|
|
document.getElementById('result').textContent = 'Error: ' + error.message;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|