新增token认证

Signed-off-by: s30035957 <sunwei158@huawei.com>
This commit is contained in:
s30035957 2024-11-15 11:20:43 +08:00
parent 98488e7cc9
commit 73ff7c85de

View File

@ -101,14 +101,6 @@ public:
return OK;
}
bool CheckFreqToken(std::string &recvStr) const {
if (recvStr.find("-lockfreq") && SPTask::GetInstance().GetTcpToken() == "") {
return false;
}
return true;
}
void TypeTcp(SpServerSocket &spSocket) const
{
SocketHeartbeat();
@ -143,9 +135,10 @@ public:
}
return;
}
if (!CheckFreqToken(recvStr)) {
if (recvStr.find("-lockfreq") != recvStr.end() &&
SPTask::GetInstance().GetTcpToken() == "") {
LOGE("lockfreq must have token");
return;
return ;
}
ErrCode code = SPTask::GetInstance().InitTask(SplitMsg(recvStr));
LOGD("init::%s", (code == ErrCode::OK) ? "True" : "False");