refactor(Linkage): optimize the parsing of expression variables (#3519)

This commit is contained in:
Zeke Zhang 2024-02-19 18:08:14 +08:00 committed by GitHub
parent c02e759830
commit a18103baa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,14 +91,13 @@ export const collectFieldStateOfLinkageRules = ({
return;
}
// 1. 解析如 `{{$user.name}}` 之类的变量
// 解析如 `{{$user.name}}` 之类的变量
const { exp, scope: expScope } = await replaceVariables(value.value || value.result, {
variables,
localVariables,
});
try {
// 2. TODO: 需要把里面解析变量的逻辑删除,因为在上一步已经解析过了
const result = evaluate(exp, { now: () => new Date().toString(), ...expScope });
return result;
} catch (error) {