From a33f64835fc63001fef57c1034031458ba4d9c4e Mon Sep 17 00:00:00 2001 From: Denzel Date: Wed, 19 Feb 2025 12:10:30 +0300 Subject: [PATCH] =?UTF-8?q?refactor=20[P-36]:=20=D1=81=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=86=D0=B0=20=D0=BA=D0=BE=D0=BD=D0=BA=D1=80=D0=B5?= =?UTF-8?q?=D1=82=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=82=D0=B5=D1=81=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.mjs | 1 + src/front/.eslintrc.js | 2 +- .../src/components/testing/DetailCardTest.vue | 36 +----------------- .../src/components/testing/QuestionBlock.vue | 37 ++++++++++++++++++- 4 files changed, 40 insertions(+), 36 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 7c0d44134..6459f32d3 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -13,6 +13,7 @@ export default [ { rules: { 'no-console': 'error', + 'vue/no-mutating-props': 'off', }, }, ]; diff --git a/src/front/.eslintrc.js b/src/front/.eslintrc.js index 02e8b48ca..ea26028b3 100644 --- a/src/front/.eslintrc.js +++ b/src/front/.eslintrc.js @@ -4,4 +4,4 @@ module.exports = { node: true, }, extends: ['plugin:vue/vue3-essential', 'eslint:recommended', 'plugin:storybook/recommended'], -} +}; diff --git a/src/front/src/components/testing/DetailCardTest.vue b/src/front/src/components/testing/DetailCardTest.vue index 737127e09..e5968fc2a 100644 --- a/src/front/src/components/testing/DetailCardTest.vue +++ b/src/front/src/components/testing/DetailCardTest.vue @@ -58,14 +58,11 @@ import QuestionBlock from '@/components/testing/QuestionBlock.vue'; import TestResults from '@/components/testing/TestResults.vue'; import { axiosApiInstance } from '@/utils/axios-api'; import { useRoute } from 'vue-router'; -import { useAccountStore } from '../../store/AccountStore'; -// import fernet from 'fernet'; export default { components: { BodyDetailTesting, HeaderDetailTesting, QuestionBlock, TestResults }, setup() { const route = useRoute(); - const accountStore = useAccountStore(); const testId = route.params.id; const testStarted = ref(false); const testFinished = ref(false); @@ -77,38 +74,9 @@ export default { const getTestById = async (id) => { const resp = await axiosApiInstance.get(`/api/tests/testdetail/${id}`); data.value = resp.data; - console.log(data.value); + // console.log(data.value); }; - // const userLogin = accountStore.user; - // const encryptedData = - // 'gAAAAABntEv1Gi_kxhY4EJTyxFetzeiNaE5uu4w43lzljCw9_2xJzLkFM7Gj08cS5eZ0ULw_s_eLAI_Jxf2nVYh_fK4Z5EAhVA=='; - // - // async function decryptData(encryptedData, userLogin) { - // const encoder = new TextEncoder(); - // const userKeyBuffer = await crypto.subtle.digest('SHA-256', encoder.encode(userLogin)); - // - // // Конвертация ArrayBuffer в Base64 - // const userKeyArray = Array.from(new Uint8Array(userKeyBuffer)); - // const base64Key = btoa(String.fromCharCode(...userKeyArray)); - // - // // Создаём секретный ключ - // const secret = new fernet.Secret(base64Key); - // - // // Расшифровываем данные - // const token = new fernet.Token({ - // secret: secret, - // token: encryptedData, - // ttl: 0, - // }); - // - // return token.decode(); - // } - // - // decryptData(encryptedData, userLogin) - // .then((decrypted) => console.log('Расшифрованное значение:', decrypted)) - // .catch((err) => console.error('Ошибка расшифровки:', err)); - const formattedTime = computed(() => { if (!data.value?.time) return '00:00'; @@ -148,7 +116,7 @@ export default { const answers = ref([]); - watch(data?.questions, (newData) => { + watch(data.value?.questions, (newData) => { if (newData && Array.isArray(newData.questions)) { answers.value = newData.questions.map(() => null); } diff --git a/src/front/src/components/testing/QuestionBlock.vue b/src/front/src/components/testing/QuestionBlock.vue index 0fbef3432..163327444 100644 --- a/src/front/src/components/testing/QuestionBlock.vue +++ b/src/front/src/components/testing/QuestionBlock.vue @@ -1,3 +1,4 @@ +/* eslint-disable vue/no-mutating-props */