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

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

View File

@@ -1,5 +1,5 @@
import axios from 'axios'
import {getSessionId} from "@/utils/storage";
import {getSessionId} from "@/store/session";
axios.defaults.timeout = 10000
axios.defaults.baseURL = process.env.VUE_APP_API_HOST

View File

@@ -1,29 +0,0 @@
/* 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))
}