diff --git a/client/src/router/index.js b/client/src/router/index.js index 200f989..9e29984 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -49,7 +49,9 @@ export default route(function (/* { store, ssrContext } */) { }); Router.beforeEach((to, from, next) => { - if (to.meta.isAuth) { + console.log(process.env.SERVER); + //уточнить зачем нужен process.env.SERVER + if (to.meta.isAuth && !process.env.SERVER) { if (store.state.user) { next(); } else { diff --git a/client/src/views/contacts.vue b/client/src/views/contacts.vue index 5296bd5..081af6f 100644 --- a/client/src/views/contacts.vue +++ b/client/src/views/contacts.vue @@ -9,36 +9,14 @@

Контакты

-
- Телефон - {{ phone }} -
-
- Почта - {{ email }} -
-
- Адрес - {{ address }} -
-
- Соц. сети -
{ - console.log([...responce]); this.contacts = { ...responce }; }); }, + mounted() {}, methods: { submitHandler() {}, + // Метод удаляет из объекта ключи с null + removeNullFields(obj) { + const result = {}; + + for (const key in obj) { + if (obj[key] !== null) { + if (typeof obj[key] === 'object' && !Array.isArray(obj[key])) { + result[key] = this.removeNullFields(obj[key]); + } else { + result[key] = obj[key]; + } + } + } + + return result; + }, + + // Метод формирует массив, на основе словаря и объекта + createArrayContacts(dictionary, fields) { + const result = []; + + for (const key in fields) { + if (dictionary[key]) { + result.push({ title: dictionary[key], data: fields[key] }); + } + } + + return result; + }, }, };