feat: add user management and role/permission management pages
deploy-chabokan / deploy (push) Canceled after 0s
deploy-chabokan / deploy (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const getAuthHeader = () => {
|
||||
const bmToken = document.cookie
|
||||
.split('; ')
|
||||
.find((row) => row.startsWith('bm-token='))
|
||||
?.split('=')[1] || localStorage.getItem('bm-token');
|
||||
return bmToken ? { Authorization: `Bearer ${bmToken}` } : {};
|
||||
};
|
||||
|
||||
export const PermissionService = {
|
||||
listPermissions: async () => {
|
||||
const response = await axios.get('/api/permissions', {
|
||||
withCredentials: true,
|
||||
headers: getAuthHeader()
|
||||
});
|
||||
return response.data.data;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user