mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 10:43:44 +08:00
feat: vue-mobile => 完善移动端聊天列表页功能
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
Reference in New Issue
Block a user