qd-today / qd

QD [v20240210] —— HTTP请求定时任务自动执行框架 base on HAR Editor and Tornado Server
https://qd-today.github.io/qd/
MIT License
4.2k stars 546 forks source link

[Bug] 使用{% for value in list(variable) %} 循环中,多次提取变量后,同变量名的值无法被修改 #519

Open yangwudong opened 5 months ago

yangwudong commented 5 months ago

Verify steps

QD Version

20240210

Bug on OS

Linux

Bug on Platform

Docker/Linux 64位

To Reproduce

  1. 创建新的模版
  2. 添加一个请求,并提取变量 - authorization_inf
  3. 然后添加for循环开始
  4. 配置循环使用 {% for value in list(variable) %}, 可以参考下面: {% for shop_id in list(org_codes) %}
  5. 在循环内,第一个请求后,在预览中提取变量,譬如变量名为:authorization_inf
image
  1. 在循环内,第二个请求中,使用该变量 - authorization_inf
image
  1. 结束循环

Describe the Bug

现在错误的结果: 变量在循环中,第一次请求后赋值可以覆盖掉变量 - authorization_inf里面的内容,但是循环到第二次或者大于1次的时候,提取变量赋值的时候,就再也无法对该变量 - authorization_inf 进行赋值替换内容,直到循环结束后,即for循环外。

QD config

No response

QD log

无报错

Expected behavior

期待结果: 变量在循环中,每次都可以在调用第一个请求后,覆盖变量名 - authorization_inf里面对应的值,以便于第二个请求的时候,传入正确的内容。

Screenshots

No response