yusr 发表于 2024-7-11 13:36:44

X3.5如何发送登录POST请求 New

假设用户名为43102827

密码为12345678

把这个POST请求发送到哪个文件
POST的数据内容是什么
我知道答案 回答被采纳将会获得1 贡献 已有4人回答

yusr 发表于 2024-7-11 13:37:19

打开页面
https://www.caogen8.co/member.php?mod=logging&action=login
查看表单元素
<form method="post" autocomplete="off" name="login" id="loginform_LgMSq" class="cl" onsubmit="pwdclear = 1;ajaxpost('loginform_LgMSq', 'returnmessage_LgMSq', 'returnmessage_LgMSq', 'onerror');return false;" action="member.php?mod=logging&action=login&loginsubmit=yes&loginhash=LgMSq"><div class="c cl"><input type="hidden" name="formhash" value="0cca2968"><input type="hidden" name="referer" value="https://www.dismall.com/thread-22748-1-1.html"><div class="rfm"><table><tbody><tr><th><span class="login_slct"><select name="loginfield" style="float: left; display: none;" width="45" id="loginfield_LgMSq" selecti="0"><option value="username"></option></select><a href="javascript:;" id="loginfield_LgMSq_ctrl" style="width:45px">用户名</a></span></th><td><input type="text" name="username" id="username_LgMSq" autocomplete="off" size="30" class="px p_fre" value="" placeholder="用户名/Email"></td></tr></tbody></table></div><div class="rfm"><table><tbody><tr><th><label for="password3_LgMSq">密码:</label></th><td><input type="password" id="password3_LgMSq" name="password" onfocus="clearpwd()" placeholder="请输入密码" size="30" class="px p_fre"></td><td><a href="javascript:;" onclick="display('layer_login_LgMSq');display('layer_lostpw_LgMSq');" title="找回密码" style="margin-left:8px;font-size:13px;color:var(--comiis-ahot)">忘记密码?</a></td></tr></tbody></table></div><div class="rfm"><table><tbody><tr><th>安全提问:</th><td><select id="loginquestionid_LgMSq" width="213" name="questionid" onchange="if($('loginquestionid_LgMSq').value > 0) {$('loginanswer_row_LgMSq').style.display='';} else {$('loginanswer_row_LgMSq').style.display='none';}"><option value="0">安全提问(未设置请忽略)</option><option value="1">母亲的名字</option><option value="2">爷爷的名字</option><option value="3">父亲出生的城市</option><option value="4">您其中一位老师的名字</option><option value="5">您个人计算机的型号</option><option value="6">您最喜欢的餐馆名称</option><option value="7">驾驶执照最后四位数字</option></select></td></tr></tbody></table></div><div class="rfm" id="loginanswer_row_LgMSq" style="display:none"><table><tbody><tr><th>答案:</th><td><input type="text" name="answer" id="loginanswer_LgMSq" placeholder="请输入答案" autocomplete="off" size="30" class="px p_fre"></td></tr></tbody></table></div><span id="seccode_cSu7JIim"><input name="seccodehash" type="hidden" value="cSu7JIim"><input name="seccodemodid" type="hidden" value="member::logging"><div class="rfm"><table><tbody><tr><th>验证码: </th><td class="comiis_login_sec"><input name="seccodeverify" id="seccodeverify_cSu7JIim" type="text" autocomplete="off" style="ime-mode:disabled;width:100px" class="txt px vm" onblur="checksec('code', 'cSu7JIim', 0, null, 'member::logging')"> <a href="javascript:;" onclick="updateseccode('cSu7JIim');doane(event);" class="xi2">换一个</a><span id="checkseccodeverify_cSu7JIim"><i class="fico-checkbox fic4 fc-t fnmr vm"></i></span><span id="vseccode_cSu7JIim">输入下图中的字符<br><img onclick="updateseccode('cSu7JIim')" width="100" height="30" src="misc.php?mod=seccode&update=38429&idhash=cSu7JIim" class="vm" alt=""></span></td></tr></tbody></table></div></span>                <script type="text/javascript" reload="1">updateseccode('cSu7JIim', '<div class="rfm"><table><tr><th><sec>: </th><td class="comiis_login_sec"><sec><sec></td></tr></table></div>', 'member::logging');</script><div class="rfm" style="margin-bottom:-10px"><table><tbody><tr><th style="padding:0 10px 0 2px"></th><td style="padding:0 2px">                                                                        <label for="cookietime_LgMSq"><input type="checkbox" class="pc" name="cookietime" id="cookietime_LgMSq" value="2592000">自动登录</label>                                                                </td></tr></tbody></table></div><div class="rfm mbm bw0"><table width="100%"><tbody><tr><th> </th><td><button class="pn pnc" type="submit" name="loginsubmit" value="true"><strong>登录</strong></button><div class="km_dzwdl">    其他登录方式    <script src="static/js/iconfont.js?NF0" type="text/javascript"></script>            <a style="margin-left: 5px" href="login.php?method=wechat" title="微信"><svg class="iconfont" aria-hidden="true"><use xlink:href="#icon-weixin"></use></svg></a>            <a style="margin-left: 5px" href="login.php?method=qq" title="QQ"><svg class="iconfont" aria-hidden="true"><use xlink:href="#icon-social-qq"></use></svg></a>            <a style="margin-left: 5px" href="login.php?method=douyin" title="抖音"><svg class="iconfont" aria-hidden="true"><use xlink:href="#icon-douyin"></use></svg></a>    </div></td><td>                                                                </td></tr></tbody></table></div></div></form>

ysx24 发表于 2024-7-11 13:37:51

这样对不对

https://www.dismall.com/data/attachment/forum/202407/05/164201c5et3tkdfnusu2m5.jpg

站帮网 发表于 2024-7-11 13:38:43

这样对不对
               * 根据密码登录               */                indexCtrl.prototype.login4pwd = function () {                        var username = $(".login-container-top input").val();                        var password = $(".login-container-top input").val();                        password = btoa(password);                        if (!username || username.trim() == '' || !password                              || password.trim() == '') {                              DialogComponent.showMsg('用户名或密码不能为空');                              return;                        }                        $.ajax({                              type: "POST",                              url: "member.php?mod=logging&action=login&loginsubmit=yes&loginhash=LgMSq",                              data: "username=" + username + "&password=" + password,                              success: function (result) {                                        if (!result) {                                                DialogComponent.showMsg("用户名或密码错误");                                                return;                                        }                                        $(".login-container-top-btn a").text("正在登录...");                                        if (!result.data || 0 == result.data.length) {                                                indexCtrl.prototype.getCurUser(function (res) {                                                      indexCtrl.prototype.bindChild(res, username, password);                                                });                                        } else if (result.data.length > 1) {                                                indexCtrl.prototype.getCurUser();                                                localStorage.setItem("all_role", JSON.stringify(result.data));                                                for (var i = 0; i < result.data.length; i++) {                                                      if (result.data.category == "TEACHER") {                                                                _this.router2Index();                                                                return;                                                      }                                                }                                                window.location.href = "toggle_role.jsp";                                                return;                                        } else {                                                indexCtrl.prototype.getCurUser();                                                _this.router2Index();                                        }                              },                              error: function (error) {                                        if (error && error.responseJSON && error.responseJSON.errorCode == '800002') {                                                window.location.href = 'stu_qrcode.jsp';                                                return;                                        }                                        var obj = eval('(' + error.responseText + ')');                                        DialogComponent.showMsg(obj.message);                              }                        });                };

ROBOT 发表于 2024-7-11 13:38:48

如果这样正确的那么接下来干什么
页: [1]
查看完整版本: X3.5如何发送登录POST请求 New