feat: admin login page is ready

This commit is contained in:
RockYang
2023-06-19 11:09:23 +08:00
parent 90bce1d437
commit 935c6caf96
12 changed files with 266 additions and 344 deletions

View File

@@ -5,20 +5,14 @@
*/
const SessionUserKey = 'LOGIN_USER';
const SessionAdminKey = 'LOGIN_ADMIN';
export function getSessionId() {
const user = getLoginUser();
return user ? user['session_id'] : '';
}
export function getLoginAdmin() {
const value = sessionStorage.getItem(SessionAdminKey);
if (value) {
return JSON.parse(value);
} else {
return null;
}
export function removeLoginUser() {
sessionStorage.removeItem(SessionUserKey)
}
export function getLoginUser() {
@@ -33,7 +27,3 @@ export function getLoginUser() {
export function setLoginUser(user) {
sessionStorage.setItem(SessionUserKey, JSON.stringify(user))
}
export function setLoginAdmin(admin) {
sessionStorage.setItem(SessionAdminKey, JSON.stringify(admin))
}