|
|
@ -15,6 +15,7 @@ void UserMgrService::initialize() { |
|
|
|
REGFN(UserMgrService, delUser); |
|
|
|
REGFN(UserMgrService, updateUserUid); |
|
|
|
REGFN(UserMgrService, getAllUser); |
|
|
|
REGFN(UserMgrService, getLoginUser); |
|
|
|
}; |
|
|
|
|
|
|
|
void UserMgrService::login(shared_ptr<MsgProcessContext> cxt) { |
|
|
@ -79,4 +80,17 @@ void UserMgrService::getAllUser(shared_ptr<MsgProcessContext> cxt) { |
|
|
|
auto users = m_db->getAllUserJson(); |
|
|
|
cxt->receipt["content"] = users; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void UserMgrService::getLoginUser(shared_ptr<MsgProcessContext> cxt) { |
|
|
|
string loginuid = m_deviceStateService->getLoginUid(); |
|
|
|
bool isLogin = m_deviceStateService->isLogin(); |
|
|
|
|
|
|
|
cxt->receipt["content"]["isLogin"] = isLogin; |
|
|
|
if (isLogin) { |
|
|
|
cxt->receipt["content"]["loginUser"] = m_db->getUserJson(loginuid); |
|
|
|
} else { |
|
|
|
cxt->receipt["content"]["loginUser"] = {}; |
|
|
|
} |
|
|
|
return; |
|
|
|
} |