login test

This commit is contained in:
2022-07-24 21:04:00 +08:00
parent 18780f13eb
commit 52da415926
3 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
<link href="static_fs/css/style.css" rel="stylesheet"> <link href="static_fs/css/style.css" rel="stylesheet">
<script src="js/function.js"></script> <script src="js/function.js?v=1"></script>
</head> </head>
<body> <body>
+4 -4
View File
@@ -50,8 +50,8 @@ function Post_Html(url,send)
{ {
var request = new XMLHttpRequest(); var request = new XMLHttpRequest();
request.open("post", url,false); request.open("post", url,false);
httpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");//设置请求头 注:post方式必须设置请求头(在建立连接后设置请求头) request.setRequestHeader("Content-type","application/x-www-form-urlencoded");//设置请求头 注:post方式必须设置请求头(在建立连接后设置请求头)
//httpRequest.send('name=teswe&ee=ef');//发送请求 将情头体写在send中 //request.send('name=teswe&ee=ef');//发送请求 将情头体写在send中
request.send(send); request.send(send);
if(request.status==200) if(request.status==200)
{ {
@@ -69,9 +69,9 @@ function Post_Html(url,send)
} }
//获取json //获取json
function Get_Json(url) function Get_Json(html)
{ {
var html = Get_Html(url);
if (html!="") { if (html!="") {
var json = JSON.parse(html); var json = JSON.parse(html);
//Printf(json); //Printf(json);
+5 -4
View File
@@ -4,8 +4,8 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sv7dgas78iref</title> <title>testttttttt</title>
<script src="js/function.js"></script> <script src="js/function.js?v=1"></script>
</head> </head>
<body> <body>
@@ -14,7 +14,8 @@
<script> <script>
Printf("login test"); Printf("login test");
var rt=Get_Html("http://ark.boxz.dev/api/club_signin/"); var rt=Post_Html("https://ark.boxz.dev/api/club_signin/","account=test&password=12345");
Printf(rt); var jss=Get_Json(rt);
Printf(jss);
</script> </script>