Изменения механизма ограничения доступа

This commit is contained in:
Book Pauk
2022-11-27 18:34:01 +07:00
parent 59b4f48897
commit abb3baf94b
3 changed files with 18 additions and 0 deletions

View File

@@ -262,6 +262,11 @@ class Api {
async getConfig() {
return await this.request({action: 'get-config'});
}
async logout() {
await this.request({action: 'logout'});
await this.request({action: 'test'});
}
}
export default vueComponent(Api);

View File

@@ -46,6 +46,14 @@
</q-tooltip>
</template>
</DivBtn>
<DivBtn v-if="!config.freeAccess" class="q-ml-sm text-white bg-secondary" :size="30" :icon-size="24" :imt="1" icon="la la-sign-out-alt" round @click.stop.prevent="logout">
<template #tooltip>
<q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%" max-width="400px">
Выход
</q-tooltip>
</template>
</DivBtn>
</div>
<div class="row q-mx-md q-mb-xs items-center">
<DivBtn
@@ -979,6 +987,10 @@ class Search {
cloneSearch() {
window.open(window.location.href, '_blank');
}
async logout() {
await this.api.logout();
}
}
export default vueComponent(Search);

View File

@@ -170,6 +170,7 @@ class WebSocketController {
async getConfig(req, ws) {
const config = _.pick(this.config, this.config.webConfigParams);
config.dbConfig = await this.webWorker.dbConfig();
config.freeAccess = this.freeAccess;
this.send(config, req, ws);
}