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