添加了权限与用户名查询

This commit is contained in:
2023-12-15 11:58:47 +00:00
parent d9fefc87b3
commit b6b9a4ffb2
2 changed files with 15 additions and 2 deletions

View File

@ -454,5 +454,6 @@ std::vector<std::string> BookStoreEngineClass::ExecuteReport(
} }
std::string BookStoreEngineClass::QueryUserInfo(const std::string &user_name) { std::string BookStoreEngineClass::QueryUserInfo(const std::string &user_name) {
return user_name + std::to_string(user_data_base.GetPrevilege(user_name)); return user_name + " " +
std::to_string(user_data_base.GetPrevilege(user_name));
} }

View File

@ -81,3 +81,15 @@ async function Request(req)
localStorage.setItem("operation_count", operation_count); localStorage.setItem("operation_count", operation_count);
} }
})(); })();
async function GetMyName()
{
let ret = await RawRequest("#Who "+session_token+" InfoQuery "+outhentication_key);
return ret.split('\n')[1].split(' ')[0];
}
async function GetMyPrivilege()
{
let ret = await RawRequest("#Who "+session_token+" InfoQuery "+outhentication_key);
return parseInt(ret.split('\n')[1].split(' ')[1]);
}