44 lines
1.0 KiB
HTML
44 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>AI 写作助手</title>
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
</head>
|
|
<body>
|
|
|
|
<div class="container">
|
|
<h1>📝 AI 写作助手</h1>
|
|
<p class="subtitle">基于通义千问的智能文本润色系统</p>
|
|
|
|
<textarea id="inputText" placeholder="请输入需要润色的文本..."></textarea>
|
|
|
|
<button onclick="rewriteText()">开始润色</button>
|
|
|
|
<div class="result-box">
|
|
<h3>✨ AI 输出结果</h3>
|
|
<div id="resultText">等待输入...</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function rewriteText() {
|
|
const text = document.getElementById("inputText").value;
|
|
|
|
fetch("/rewrite", {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify({ text: text })
|
|
})
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
document.getElementById("resultText").innerText = data.result;
|
|
});
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|