Работа над приложением

This commit is contained in:
Book Pauk
2022-08-19 00:24:05 +07:00
parent 3877ad15c1
commit adb1d55141
9 changed files with 227 additions and 36 deletions

View File

@@ -24,6 +24,20 @@ class Api {
}
mounted() {
this.updateConfig();//no await
}
async updateConfig() {
try {
const config = await this.getConfig();
this.commit('setConfig', config);
} catch (e) {
this.$root.stdDialog.alert(e.message, 'Ошибка');
}
}
get config() {
return this.$store.state.config;
}
async request(params) {
@@ -40,7 +54,7 @@ class Api {
return response;
}
async config() {
async getConfig() {
const response = await this.request({action: 'get-config'});
if (response.error) {