mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 18:53:43 +08:00
feat: admin login page is ready
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user