Bootstrap

jmeter beanshell 中签名的用法

import com.test.mymd5;
import net.sf.json.JSONObject;
import java.net.URLEncoder;

String orderPayParam = vars.get("orderPayParam");
orderPayParam = JSONObject.fromObject(orderPayParam).toString();
log.info("orderPayParam="+orderPayParam);

String str = "_aid="+"3"+"_ch="+"wap"+"_domid="+"1000"+"_ft="+"json"+"_lat="+"22.539405"
            + "_lng="+"113.953207"+"_mt="+"trademanager.batchPay"+"_sm="+"md5"+"_tk="+"Em32TXFF5J1NlELY497To14nyQJl8PQs"+"_uid="+"10035872"+"orderPayParam="+orderPayParam+"0ce37dd6b927730161a1e559c2336d0a";


//System.out.println(str);
log.info("str="+str);
String sign = mymd5.getMd5(str);
String _sig = sign;
log.info("_sig="+_sig);
//System.out.println(_sig);
vars.put("_sig",_sig);
orderPayParam= URLEncoder.encode(orderPayParam,"utf-8");
log.info("orderPayParam="+orderPayParam);
vars.put("orderPayParam",orderPayParam);

;