How does ApiPost automatically log in to obtain token and set it as a global variable

How does ApiPost automatically log in to obtain token and set it as a global variable

directly on the code

 console.log("执行全局脚本");
 $.ajax({
 	"url":apt.variables.getPreUrl()+"/loginWithOutCode",
 	"method":"POST",
 	"async":false,	
 	headers:{
       "content-type":"application/json"
    },
	"data":JSON.stringify({"username": "admin","password": "admin123"}),
 	"success":function(response){
 		response = typeof response == "object" ? response : JSON.parse(response);
		console.log("执行成功:");
 		console.log(response);
 		apt.globals.set("token",  response.token);
 	}
 });

Guess you like

Origin blog.csdn.net/geshi201028/article/details/124635614