新增token认证

Signed-off-by: s30035957 <sunwei158@huawei.com>
This commit is contained in:
s30035957 2024-11-08 15:39:54 +08:00
parent a46c2a3ba2
commit ec26ca9d57

View File

@ -94,7 +94,11 @@ public:
{
std::string token = recvStr.substr(recvStr.find_last_of(":") + 1);
token = token.substr(0, token.find(' '));
if (token != SPTask::GetInstance().GetTcpToken()) {
std::string tcpToken = SPTask::GetInstance().GetTcpToken();
if(tcpToken == "" && token == "-SESSIONID") {
return OK;
}
if (token != tcpToken) {
return TOKEN_CHECK_FAILED;
}