Action(){ char *url = " ; char *projectID = "2368"; char ts[1024]; char key[1024]; char *key_test = "$>51>2H34p/,txaP"; char combining[1024]; char *t = "那个abcd你好吗,哈哈,ANMOL"; int i = 0; int j = 0; char *enc=""; char md5_result[100]; char token[100] ; char url_post[1024]; char url_result[1024]; web_save_timestamp_param("tStamp", LAST); sprintf(ts, "%s",lr_eval_string("{tStamp}") ); lr_error_message("%s",ts); // token = md5 ( Base64( XXTea( projectId + ts, KEY) ) ); sprintf(combining,"%s%s%s",projectID,ts,key_test); lr_error_message("combining=%s",combining); //进行base编码: j = strlen(combining); enc = base64_encode(combining, j); lr_error_message("enc=%s",enc); //进行md5编码 GetMd5FromString(enc,md5_result); lr_error_message("md5_result=%s",md5_result); sprintf(token,"%s",md5_result); lr_error_message("token=%s",token); //组装url sprintf(url_post,"%s%s%s%s%s%s%s",url,"projectId=",projectID,"&token=",token,"&ts=",ts); lr_save_string(url_post,"url_result"); // projectId + ts, KEY lr_error_message("url_result=%s",lr_eval_string("{url_result}")); web_reg_save_param("error", "LB=", "RB=", "NotFound=ERROR", "Search=Body", LAST); web_custom_request("CommonQueryDialog.jsf_3", "URL={url_result}", "Method=POST", "Resource=0", "RecContentType=application/json", "Mode=HTML", "EncType=application/x-www-form-urlencoded;charset=UTF-8", "Body={\"productList\":[{\"operateType\":\"insert\", \"productNo\":\"1001\"\"productName\":\"aaa\",\"catalogNo1\":\"no1\", \"catalogName1\":\"noName1\"," "\"catalogNo2\":\"no2\", " "\"catalogName2\":\"noName2\",\"catalogNo3\":\"no3\", \"catalogName3\":\"noName3\",\"url\":\"\",\"price\":\"100\"," "\" sellStartTime\":\"2010-10-10 10:10:10\",\"sellEndTime\":\"2010-10-10 10:10:10\"},{\"operateType\":\"insert\",\"productNo\":\"1002\"" "\"productName\":\"bbb\",\"catalogNo1\":\"bno1\", \"catalogName1\":\"bnoName1\",\"catalogNo2\":\"bno2\", \"catalogName2\":\"bnoName2\"," "\"catalogNo3\":\"bno3\",\"catalogName3\":\"bnoName3\",\"url\":\"\", \"price\":\"101\",\"sellStartTime\":\"2010-10-10 10:10:10\"," "\"sellEndTime\":\"2010-10-10 10:10:10\"}]}", LAST); lr_error_message("error=%s",lr_eval_string("{error}")); return 0;}
阅读(1796) | 评论(0) | 转发(0) |