Chinaunix首页 | 论坛 | 博客
  • 博客访问: 661772
  • 博文数量: 53
  • 博客积分: 830
  • 博客等级: 准尉
  • 技术积分: 1089
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-31 18:23
文章存档

2019年(1)

2018年(1)

2016年(1)

2015年(1)

2014年(12)

2013年(4)

2012年(33)

分类: Java

2015-03-24 14:40:00

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
}


阅读(1610) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~