feat: vue-mobile => 完善移动端聊天列表页功能

This commit is contained in:
RockYang
2023-06-25 17:01:04 +08:00
parent 2c172c0851
commit 811f12135a
11 changed files with 385 additions and 41 deletions

29
web/src/store/session.js Normal file
View File

@@ -0,0 +1,29 @@
/* eslint-disable no-constant-condition */
/**
* storage handler
*/
const SessionUserKey = 'LOGIN_USER';
export function getSessionId() {
const user = getLoginUser();
return user ? user['session_id'] : '';
}
export function removeLoginUser() {
sessionStorage.removeItem(SessionUserKey)
}
export function getLoginUser() {
const value = sessionStorage.getItem(SessionUserKey);
if (value) {
return JSON.parse(value);
} else {
return null;
}
}
export function setLoginUser(user) {
sessionStorage.setItem(SessionUserKey, JSON.stringify(user))
}