import lrapi.lr;
import lrapi.web;
import com.commons.utils.AesEncryUtil;
public class Actions
{
public int init() throws Throwable {
return 0;
}//end of init
public int action() throws Throwable {
web.add_header("ChannelIdbbbb","ew");
web.add_header("CheckCodeabc","");
web.add_header("ClientTypeeEF","1");
web.add_header("DeviceIdgR","TestWeb");
web.add_header("SessionTokentEN","");
web.add_header("Version","6.8.0");
web.add_header("pversioneE","1.2");
String text = "{\"clientIp\":\"\",\"clientType\":\"\",\"mobileNo\":\"19705471078\"}" ;
String encryptStr = AesEncryUtil.encryptByKey(text, "EdD2u8899EGkohdES");
// System.err.println("ddd="+encryptStr);
web.reg_save_param ("error",
new String []{
"NOTFOUND=ERROR",
"LB=",
"RB=" ,
"LAST"} );
web.reg_find("Text=\"IsError\":false",
new String []{"SaveCount=count", "LAST"});
lr.start_transaction("getDynamicLRegisterCode");
this.body(encryptStr);
if (lr.eval_int("
") > 0){
lr.end_transaction("aaaaaaa", lr.PASS);
}else{
lr.end_transaction("aaaaaaa", lr.FAIL);
String errorInfor = "{\""+lr.eval_string("")+"}";
lr.error_message(errorInfor);
}
return 0;
}//end of action
public void body(String encryptStr ){
try{
String htmlBody = encryptStr;
web.url("",
"URL="+htmlBody,
new String[]{
"Resource=0",
"RecContentType=application/json", //RecContentType=application/json
"Mode=HTML",
"LAST"
});
}
// web.custom_request("post_query.exe",
// "Method=get",
// new String[]{
// "URL="+htmlBody,
// htmlBody, // String object is not in quotes
// "LAST"});
// }
catch (Exception e) {}
}
//lr.error_message("error="+error) ;
public int end() throws Throwable {
return 0;
}//end of end
}