new package dbHandler accesscontrol memeberdb and login with rights
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 2m20s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 5m27s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 5m32s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 5m28s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 5m29s
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 2m20s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 5m27s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 5m32s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 5m28s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 5m29s
This commit is contained in:
@@ -3,6 +3,8 @@ import { ref, computed } from 'vue';
|
||||
import { useNotify } from 'src/vueLib/general/useNotify';
|
||||
import { i18n } from 'boot/lang';
|
||||
import type { Roles } from 'src/vueLib/models/roles';
|
||||
import { useUserStore } from 'src/vueLib/login/userStore';
|
||||
import { useLogin } from 'src/vueLib/login/useLogin';
|
||||
|
||||
export const roles = ref<Roles>([]);
|
||||
|
||||
@@ -31,11 +33,10 @@ export function useRoleTable() {
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'rights',
|
||||
name: 'permissions',
|
||||
align: 'left' as const,
|
||||
label: i18n.global.t('rights'),
|
||||
field: 'rights',
|
||||
sortable: true,
|
||||
label: i18n.global.t('permissions'),
|
||||
field: '',
|
||||
style: 'width: 120px; max-width: 120px;',
|
||||
},
|
||||
{ name: 'option', align: 'center' as const, label: '', field: 'option', icon: 'option' },
|
||||
@@ -44,18 +45,21 @@ export function useRoleTable() {
|
||||
const { NotifyResponse } = useNotify();
|
||||
|
||||
const loading = ref(false);
|
||||
const userStore = useUserStore();
|
||||
const login = useLogin();
|
||||
|
||||
//updates user list from database
|
||||
function updateRoles() {
|
||||
async function updateRoles() {
|
||||
loading.value = true;
|
||||
appApi
|
||||
.get('secure/roles')
|
||||
await appApi
|
||||
.get('roles?id=0')
|
||||
.then((resp) => {
|
||||
if (resp.data === null) {
|
||||
roles.value = [];
|
||||
return;
|
||||
}
|
||||
roles.value = resp.data as Roles;
|
||||
|
||||
if (roles.value === null) {
|
||||
roles.value = [];
|
||||
return;
|
||||
@@ -68,6 +72,17 @@ export function useRoleTable() {
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
await appApi
|
||||
.get('/login/me')
|
||||
.then((resp) => {
|
||||
userStore
|
||||
.setUser({ id: resp.data.id, username: resp.data.username, role: resp.data.role })
|
||||
.catch((err) => console.log(err));
|
||||
login.refresh().catch((err) => console.error(err));
|
||||
})
|
||||
.catch(() => {
|
||||
login.logout().catch((err) => console.error(err));
|
||||
});
|
||||
}
|
||||
return {
|
||||
roles,
|
||||
|
||||
Reference in New Issue
Block a user