diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue b/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue index f22013548..f677ee254 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue @@ -22,18 +22,20 @@
- + - + +
- + - + +
diff --git a/nezha-fronted/src/components/page/config/system/apiKeyTable.vue b/nezha-fronted/src/components/page/config/system/apiKeyTable.vue index a604e699a..13259d3a4 100644 --- a/nezha-fronted/src/components/page/config/system/apiKeyTable.vue +++ b/nezha-fronted/src/components/page/config/system/apiKeyTable.vue @@ -43,7 +43,7 @@ diff --git a/nezha-fronted/src/main.js b/nezha-fronted/src/main.js index 433df1a74..f9a43a0d2 100644 --- a/nezha-fronted/src/main.js +++ b/nezha-fronted/src/main.js @@ -200,6 +200,9 @@ Vue.mixin({ } }, computed: { + timeFormatMain () { + return this.$store.getters.getTimeFormatMain + }, getMenuList () { return this.$store.state.user.menuList }, diff --git a/nezha-fronted/src/store/index.js b/nezha-fronted/src/store/index.js index ec9826625..68e0d387b 100644 --- a/nezha-fronted/src/store/index.js +++ b/nezha-fronted/src/store/index.js @@ -39,9 +39,13 @@ const store = new Vuex.Store({ isShrink: localStorage.getItem('nz-left-menu-shrink') == 'true', metricsList: [], langList: [], - i18nReady: false + i18nReady: false, + timeFormatMain: localStorage.getItem('nz-default-dateFormat') || 'YYYY-MM-DD HH:mm:ss' }, getters: { + getTimeFormatMain (state) { + return state.timeFormatMain + }, getLinkData (state) { return state.linkData }, @@ -167,6 +171,10 @@ const store = new Vuex.Store({ setLangList (state, langList) { state.langList = langList }, + setTimeFormatMain (state, timeFormat) { + console.log(timeFormat) + state.timeFormatMain = timeFormat + }, i18nReady (state, ready) { state.i18nReady = ready } diff --git a/nezha-fronted/src/store/user.js b/nezha-fronted/src/store/user.js index 1a25e57a8..f0b116490 100644 --- a/nezha-fronted/src/store/user.js +++ b/nezha-fronted/src/store/user.js @@ -76,6 +76,7 @@ const user = { localStorage.setItem('nz-unnsaved-change', res.data.unsavedChange) localStorage.setItem('nz-mfa-enable', Number(res.data.mfaAuthEnable) ? 1 : 0) store.commit('setLanguage', res.data.user.lang || defaultAppearance.language) + store.commit('setTimeFormatMain', localStorage.getItem('nz-default-dateFormat')) post('/sys/user/permissions', { token: res.data.token }).then(res => { const menuList = sortByOrderNum(res.data.menus) store.commit('setMenuList', menuList)