引入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', {
|
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
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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>
|
||||||
Reference in new issue
Block a user