diff --git a/README.md b/README.md index 845e4fb..cd526d8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# -

vue-admin-beautiful(element-ui)

diff --git a/package.json b/package.json index caa7043..59a66e3 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "dependencies": { "axios": "^0.21.0", "clipboard": "^2.0.6", - "core-js": "^3.7.0", + "core-js": "^3.8.0", "dayjs": "^1.9.6", "echarts": "^4.9.0", "echarts-wordcloud": "^1.1.3", @@ -58,7 +58,7 @@ "vue": "^2.6.12", "vue-echarts": "^5.0.0-beta.0", "vue-router": "^3.4.9", - "vuex": "^3.5.1", + "vuex": "^3.6.0", "zx-comparison": "^1.0.3", "zx-count": "^0.3.7", "zx-layouts": "^0.6.21", diff --git a/src/store/modules/errorLog.js b/src/store/modules/errorLog.js index 71eec0d..941c6e5 100644 --- a/src/store/modules/errorLog.js +++ b/src/store/modules/errorLog.js @@ -3,7 +3,9 @@ * @description 异常捕获的状态拦截,请勿修改 */ -const state = { errorLogs: [] } +const state = () => ({ + errorLogs: [], +}) const getters = { errorLogs: (state) => state.errorLogs, } diff --git a/src/store/modules/routes.js b/src/store/modules/routes.js index ce5555c..73db2fe 100644 --- a/src/store/modules/routes.js +++ b/src/store/modules/routes.js @@ -6,7 +6,10 @@ import { asyncRoutes, constantRoutes } from '@/router' import { getRouterList } from '@/api/router' import { convertRouter, filterAsyncRoutes } from '@/utils/handleRoutes' -const state = { routes: [], partialRoutes: [] } +const state = () => ({ + routes: [], + partialRoutes: [], +}) const getters = { routes: (state) => state.routes, partialRoutes: (state) => state.partialRoutes, diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index c414d3e..fc7cf9d 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -8,7 +8,7 @@ import defaultSettings from '@/config' const { tabsBar, logo, layout, header, themeBar } = defaultSettings const theme = JSON.parse(localStorage.getItem('vue-admin-beautiful-theme')) || '' -const state = { +const state = () => ({ tabsBar: theme.tabsBar || tabsBar, logo, collapse: false, @@ -16,7 +16,7 @@ const state = { header: theme.header || header, device: 'desktop', themeBar, -} +}) const getters = { collapse: (state) => state.collapse, device: (state) => state.device, diff --git a/src/store/modules/table.js b/src/store/modules/table.js index 62f5f4b..bf57c09 100644 --- a/src/store/modules/table.js +++ b/src/store/modules/table.js @@ -3,7 +3,9 @@ * @description 代码生成机状态管理 */ -const state = { srcCode: '' } +const state = () => ({ + srcCode: '', +}) const getters = { srcTableCode: (state) => state.srcCode, } diff --git a/src/store/modules/tabsBar.js b/src/store/modules/tabsBar.js index bbbd911..d53aa63 100644 --- a/src/store/modules/tabsBar.js +++ b/src/store/modules/tabsBar.js @@ -3,9 +3,9 @@ * @description tabsBar多标签页逻辑,前期借鉴了很多开源项目发现都有个共同的特点很繁琐并不符合框架设计的初衷,后来在github用户cyea的启发下完成了重构,请勿修改 */ -const state = { +const state = () => ({ visitedRoutes: [], -} +}) const getters = { visitedRoutes: (state) => state.visitedRoutes, } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 5f5c8a1..24d681e 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -13,12 +13,12 @@ import { import { resetRouter } from '@/router' import { title, tokenName } from '@/config' -const state = { +const state = () => ({ accessToken: getAccessToken(), username: '', avatar: '', permissions: [], -} +}) const getters = { accessToken: (state) => state.accessToken, username: (state) => state.username,