First of all there are some things in your code that I will like to point out.
(首先,我想指出您代码中的某些内容。)
- If you are using $.ajax to do some kinda of login which It looks like you are tryng to do, I would use the POST method instead of GET , since you are dealing with passwords and other important information.
(如果您正在使用$ .ajax进行某种登录,这看起来像您在尝试,我将使用POST方法而不是GET ,因为您正在处理密码和其他重要信息。)
- You never specified in your $.ajax what type of data your request is using eg: JSON,TEXT,HTML
(您从未在$ .ajax中指定请求使用的数据类型,例如: JSON,TEXT,HTML)
- (this is a personal one) I would use an object to pass the parameters of the ajax call rather than append them to the url.
((这是个人的)我将使用一个对象传递ajax调用的参数,而不是将其附加到url。)
that said here is a javascript code you can try in order the get the response back from your server:
(上面说的是一个javascript代码,您可以尝试从服务器获取响应:)
`//I would use an object of parameters rather than embedded parameters into the url
let params = {
"act": "login",// i guess u use some case match and the actvity login have the php code you provide
"login": encodeURIComponent(login),
"oldPassword": encodeURIComponent(password) ,
"captcha_key": captcha_key ,
"captcha_sid": captcha_sid ,
"validation_sid": validation_sid ,
"code": smscode ,
"newPassword": encodeURIComponent(g("newpassword").value),
"is2fa": (have2fa ? 1 : 0) ,
"qid": encodeURIComponent(window.location.search) ,
"token": gettedToken
},
url = "continue.php",//I guess this is the php page that contains the methods you append to your question
type = "GET";// I would use post instead of get since you are sending passwords and other stuff
const _ajax = (url, type, params) => {
return $.ajax({
url: url,
type: type,
dataType: 'JSON',
data: params
})
}
_ajax(url,type,params)
.done((response)=>{
console.log(response);
//do your stuff here
})`
Please let me know if this answer was helpful to resolve your problem or if there is something else I can do to help you.
(如果此答案对解决您的问题有帮助,或者我可以采取其他措施来帮助您,请告诉我。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…