eolinker parameter passing solution (the value of the specified parameter)

First, Case 1

1 , the scene description:

Front and rear to provide a request requires a data request to request data structure, such as the return merchandise new commodity ID , goods need to obtain access ID to construct a request, the page request to achieve product testing {

 "Status": true,

 "Msg": "266685",

 "Data": null

 }

 

2 , use the code:

response=JSON.parse(response);

env.globalParams["Msg"]=response["Msg"];

 

 

 

 

3, step

(1) prior to a request (hereinafter called A request) disposed "code injection" enter step " 2 Script" in the return value to the global variable " Msg ." " Msg " Representative A request returned data, in case A request for the new product, the returned Msg name of the parameter, the value of commodity ID

(2) a request later (hereinafter called B request) request URL plus the variable "within Msg ", writing format " {Msg} {}", the entire request URL is

store2948.xiaokeduo.com/did1115990/Product/Details/{{Msg}}

 

So that is variable to achieve mass participation application

 

 

Second, Case 2

1, the value needs to be taken out of storage at a certain value, such as the following Unicode , is data in parentheses after the

 

 

 

2, obtaining unicode code values for

 

response=JSON.parse(response);

env.globalParams["unicode"]=response["Data"]["unicode"];

     

 

 

 

 

I.e. data followed by a lower value Unicode

 

Third, an array of values

1, the view of the interface to return a string of data within the array, while the rear interface is a need to remove that value from the value of the application string array.

 

 

 

2 , a first example, take the " ID " 43 is

 

 

 

 

 

3 , written below, where " 0 " represents a first take " ID value"

 

 

 

 

response=JSON.parse(response);

env.globalParams["weid"]=response["Data"]["PageList"][0]["Id"];

 

 

4 , if the value of the required data, the most forward position from the array, the value of the rule

 

 

 

response=JSON.parse(response);

env.globalParams["Coupon"]=response["Data"][response["Data"].length-1]["Id"];

 

The above represents the contents, Data taken last in the array id refers to content provided to the global variable

 

Guess you like

Origin www.cnblogs.com/becks/p/12508842.html