mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-14 05:03:45 +08:00
feat: change theme for mobile site is ready
This commit is contained in:
6
web/src/store/eventbus.js
Normal file
6
web/src/store/eventbus.js
Normal file
@@ -0,0 +1,6 @@
|
||||
// 导入mitt包
|
||||
import mitt from 'mitt'
|
||||
// 创建EventBus实例对象
|
||||
const bus = mitt()
|
||||
// 共享出eventbus的实例对象
|
||||
export default bus
|
||||
@@ -5,25 +5,11 @@ import Storage from "good-storage";
|
||||
* storage handler
|
||||
*/
|
||||
|
||||
const SessionIDKey = process.env.VUE_APP_KEY_PREFIX + 'SESSION_ID';
|
||||
const UserTokenKey = process.env.VUE_APP_KEY_PREFIX + "Authorization";
|
||||
const AdminTokenKey = process.env.VUE_APP_KEY_PREFIX + "Admin-Authorization"
|
||||
|
||||
export function getSessionId() {
|
||||
let sessionId = Storage.get(SessionIDKey)
|
||||
if (!sessionId) {
|
||||
sessionId = randString(42)
|
||||
setSessionId(sessionId)
|
||||
}
|
||||
return sessionId
|
||||
}
|
||||
|
||||
export function removeSessionId() {
|
||||
Storage.remove(SessionIDKey)
|
||||
}
|
||||
|
||||
export function setSessionId(sessionId) {
|
||||
Storage.set(SessionIDKey, sessionId)
|
||||
return randString(42)
|
||||
}
|
||||
|
||||
export function getUserToken() {
|
||||
|
||||
Reference in New Issue
Block a user