引入validation.js,修改Content-Type

This commit is contained in:
qing committed 2026-07-21 21:55:52 +08:00
1 parent b1f0aec4ab
commit 1d57502fa2
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -127,7 +127,7 @@ form.addEventListener('submit', async function(e) {
const res = await fetch('/login', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Type': 'application/json' // 告诉服务器内容为json
},
body: jsonBody
});
+1
View File
@@ -42,6 +42,7 @@
<span id="agreeTip"></span>
</div>
</form>
<script src="js/validation.js"></script>
<script src="js/login.js"></script>
</body>
</html>