优化代码

This commit is contained in:
刘祥超
2022-01-09 10:53:21 +08:00
parent b6cc826a54
commit ecaa45db34
4 changed files with 26 additions and 1 deletions

View File

@@ -949,6 +949,22 @@ func (this *HTTPRequest) Format(source string) string {
}
}
// product
if prefix == "product" {
switch suffix {
case "name":
if sharedNodeConfig.ProductConfig != nil && len(sharedNodeConfig.ProductConfig.Name) > 0 {
return sharedNodeConfig.ProductConfig.Name
}
return teaconst.GlobalProductName
case "version":
if sharedNodeConfig.ProductConfig != nil && len(sharedNodeConfig.ProductConfig.Version) > 0 {
return sharedNodeConfig.ProductConfig.Version
}
return teaconst.Version
}
}
return "${" + varName + "}"
})
}