|
|
@ -2,6 +2,7 @@ import qs from 'qs';
|
|
|
|
|
|
|
|
|
|
|
|
const TOKEN_KEY = 'access_token'
|
|
|
|
const TOKEN_KEY = 'access_token'
|
|
|
|
const USER = 'user'
|
|
|
|
const USER = 'user'
|
|
|
|
|
|
|
|
const CATEGORYNAME = 'category_name'
|
|
|
|
const PERMISSION = 'permission'
|
|
|
|
const PERMISSION = 'permission'
|
|
|
|
const VIRTUALACTIVITY = 'virtual_activity'
|
|
|
|
const VIRTUALACTIVITY = 'virtual_activity'
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -23,6 +24,23 @@ const TokenService = {
|
|
|
|
localStorage.removeItem(TOKEN_KEY)
|
|
|
|
localStorage.removeItem(TOKEN_KEY)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const CategoryNameService = {
|
|
|
|
|
|
|
|
get() {
|
|
|
|
|
|
|
|
if (localStorage.getItem(CATEGORYNAME)) {
|
|
|
|
|
|
|
|
return qs.parse(localStorage.getItem(CATEGORYNAME))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
save(category_name = null) {
|
|
|
|
|
|
|
|
category_name = qs.stringify(category_name);
|
|
|
|
|
|
|
|
localStorage.setItem(CATEGORYNAME, category_name)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
remove() {
|
|
|
|
|
|
|
|
localStorage.removeItem(CATEGORYNAME)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const UserService = {
|
|
|
|
const UserService = {
|
|
|
|
get() {
|
|
|
|
get() {
|
|
|
@ -77,4 +95,4 @@ const VirtualActivityService = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export { TokenService, UserService, PermissionService, VirtualActivityService }
|
|
|
|
export { TokenService, UserService, PermissionService, VirtualActivityService, CategoryNameService }
|
|
|
|