diff --git a/src/naming/NamingProxy.cpp b/src/naming/NamingProxy.cpp index 4555ee1..4247275 100644 --- a/src/naming/NamingProxy.cpp +++ b/src/naming/NamingProxy.cpp @@ -150,14 +150,18 @@ NacosString NamingProxy::callServer } NacosString NamingProxy::getDataToSign(const std::list ¶mValues, NacosString &nowTimeMs) { + const NacosString &groupName = ParamUtils::findByKey(paramValues, NamingConstant::GROUP_NAME); const NacosString &serviceName = ParamUtils::findByKey(paramValues, NamingConstant::SERVICE_NAME); - NacosString dataToSign = ""; + NacosString dataToSign = "" + nowTimeMs; if (!ParamUtils::isBlank(serviceName)) { - dataToSign = serviceName + "@@"; + if (ParamUtils::contains(serviceName, "@@") || ParamUtils::isBlank(groupName)) { + dataToSign += "@@" + serviceName; + } else { + dataToSign += "@@" + groupName + "@@" + serviceName; + } } - dataToSign += nowTimeMs; return dataToSign; }