From 3f9ce4eaf391733e8769caec8da84302c012b21e Mon Sep 17 00:00:00 2001 From: Maksim Zakharov Date: Wed, 27 Apr 2022 14:59:55 +0300 Subject: restyled login page --- .../modules/Authentication/AuthenticanStore.js | 27 ++++++++++++++++++++++ src/store/modules/GlobalStore.js | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'src/store/modules') diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js index 07d5ee8b..3588207a 100644 --- a/src/store/modules/Authentication/AuthenticanStore.js +++ b/src/store/modules/Authentication/AuthenticanStore.js @@ -6,8 +6,14 @@ const AuthenticationStore = { namespaced: true, state: { authError: false, + // для работы локально // + // xsrfCookie: true, + // isAuthenticatedCookie: true, + // + // для сборки образа // xsrfCookie: Cookies.get('XSRF-TOKEN'), isAuthenticatedCookie: Cookies.get('IsAuthenticated'), + //// }, getters: { authError: (state) => state.authError, @@ -19,11 +25,15 @@ const AuthenticationStore = { token: (state) => state.xsrfCookie, }, mutations: { + //Расскомментить этот + // authSuccess() { + //Закомментить этот код authSuccess(state) { state.authError = false; state.xsrfCookie = Cookies.get('XSRF-TOKEN'); }, authError(state, authError = true) { + // authError() { state.authError = authError; }, logout(state) { @@ -35,6 +45,12 @@ const AuthenticationStore = { }, }, actions: { + // для работы локально // + // login({ commit }) { + // commit('authError', false); + // commit('authSuccess'); + // }, + // для сборки образа // login({ commit }, { username, password }) { commit('authError', false); return api @@ -45,6 +61,7 @@ const AuthenticationStore = { throw new Error(error); }); }, + ///// logout({ commit }) { api .post('/logout', { data: [] }) @@ -52,17 +69,27 @@ const AuthenticationStore = { .then(() => router.go('/login')) .catch((error) => console.log(error)); }, + // для работы локально // + // checkPasswordChangeRequired() { + // return false; + // }, + // для сборки образа // checkPasswordChangeRequired(_, username) { api .get(`/redfish/v1/AccountService/Accounts/${username}`) .then(({ data: { PasswordChangeRequired } }) => PasswordChangeRequired) .catch((error) => console.log(error)); }, + /////// + // для работы локально // + // resetStoreState() {}, + // для сборки образа // resetStoreState({ state }) { state.authError = false; state.xsrfCookie = Cookies.get('XSRF-TOKEN'); state.isAuthenticatedCookie = Cookies.get('IsAuthenticated'); }, + ////// }, }; diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js index 95d7a083..17355613 100644 --- a/src/store/modules/GlobalStore.js +++ b/src/store/modules/GlobalStore.js @@ -34,7 +34,7 @@ const GlobalStore = { modelType: null, serialNumber: null, serverStatus: 'unreachable', - languagePreference: localStorage.getItem('storedLanguage') || 'en-US', + languagePreference: localStorage.getItem('storedLanguage') || 'ru-RU', isUtcDisplay: localStorage.getItem('storedUtcDisplay') ? JSON.parse(localStorage.getItem('storedUtcDisplay')) : true, -- cgit v1.2.3