Action()
{
web_add_header("Authorization","Basic emx0OnpsdA==");
web_reg_save_param("token",
"LB={\"datas\":{\"access_token\":\"",
"RB=\",\"token_type\"",
"Search=Body",
LAST);
lr_start_transaction("登录");
web_submit_data("token_2",
"Action=http://172.16.2.89:9900/api-uaa/oauth/user/token",
"Method=POST",
"RecContentType=application/json",
"Referer=http://172.16.2.89:1081/login.html",
"Snapshot=t9.inf",
"Mode=HTML",
ITEMDATA,
"Name=username", "Value={username}", ENDITEM,
"Name=password", "Value=111111", ENDITEM,
"Name=validCode", "Value=1", ENDITEM,
"Name=deviceId", "Value=2C83404C-FA43-47D8-83BF-720EA6F81A38", ENDITEM,
LAST);
web_url("index.html",
"URL=http://172.16.2.89:1081/index.html",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.16.2.89:1081/login.html",
"Snapshot=t10.inf",
"Mode=HTML",
EXTRARES,
//"Url=/favicon.ico", "Referer=", ENDITEM,
LAST);
lr_end_transaction("登录", LR_AUTO);
lr_start_transaction("获取用户信息");
web_url("网页别名_2",
"URL=http://172.16.2.89:9900/api-user/userinfo/user/{username}?access_token={token}",
"Resource=0",
"RecContentType=application/json",
"Referer=http://172.16.2.89:1081/index.html",
"Snapshot=t12.inf",
"Mode=HTML",
LAST);
lr_end_transaction("获取用户信息", LR_AUTO);
//lr_output_message("当前token为:%s", lr_eval_string("{token}"));
return 0;
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
- 45.
- 46.
- 47.
- 48.
- 49.
- 50.
- 51.
- 52.
- 53.
- 54.
- 55.
- 56.
- 57.
- 58.
- 59.
- 60.