如果用户第二次访问域,反应会有所不同

问题描述 投票:0回答:1

我正在构建一个 Kynetx 应用程序,如果用户第二次访问该页面,该应用程序会在域上触发不同的操作。我认为我需要使用持久跟踪来标记用户何时访问页面,但我不确定如何检查跟踪以查看值是否已存在并与当前域匹配。

当前代码:

rule put_data_onto_trail {
  select when pageview ".*"
  pre {
    domain = page:url("domain");
  }
  {
    notify("Thanks for visiting #{domain}","You visit has been recorded") with sticky = true;
  }
  fired {
    mark ent:visitedDomains with domain;
  }
}
dns persistent audit-trail krl
1个回答
2
投票

KRL 为此提供了

seen
运算符。它将正则表达式作为字符串。所以你的
if
检查可能看起来像这样:

if seen ".*awesome.*" in ent:mytrail then {
    // take over the world
}
© www.soinside.com 2019 - 2024. All rights reserved.