引入validation.js,修改Content-Type
This commit is contained in:
1 parent
b1f0aec4ab
commit
1d57502fa2
2 files changed
+2
-1
No files matched your search
@@ -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
|
||||
});
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
<span id="agreeTip"></span>
|
||||
</div>
|
||||
</form>
|
||||
<script src="js/validation.js"></script>
|
||||
<script src="js/login.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user