diff --git a/src/assets/img/no-widgets.svg b/src/assets/img/no-widgets.svg deleted file mode 100644 index ec8b3ae..0000000 --- a/src/assets/img/no-widgets.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/layout/components/userbar.vue b/src/layout/components/userbar.vue index 0f78616..27d1f1c 100644 --- a/src/layout/components/userbar.vue +++ b/src/layout/components/userbar.vue @@ -119,7 +119,7 @@ } }, created() { - var userInfo = this.$tool.data.get("userinfo"); + var userInfo = this.$tool.data.get("user"); this.username = userInfo.username; this.avatar = userInfo.avatar; }, diff --git a/src/main.js b/src/main.js index afb5fc4..6945ca6 100644 --- a/src/main.js +++ b/src/main.js @@ -2,7 +2,7 @@ import { createApp } from 'vue' import ElementPlus from 'element-plus' import 'element-plus/dist/index.css' import 'element-plus/theme-chalk/display.css' -import scui from './scui' +import x from './x' import i18n from './locales' import router from './router' import store from './store' @@ -14,7 +14,7 @@ app.use(store); app.use(router); app.use(ElementPlus); app.use(i18n); -app.use(scui); +app.use(x); //挂载app app.mount('#app'); diff --git a/src/router/index.js b/src/router/index.js index 29a3046..987fca0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -66,10 +66,13 @@ router.beforeEach(async (to, from, next) => { if (!isGetRouter) { // 重新获取菜单路 api.system.index.get().then((response) => { - tool.data.set("menu", response.data.menu) - tool.data.set("userinfo", response.data.user) - tool.data.set("permissions", response.data.permissions) - tool.data.set("dashboardgrid", response.data.dashboardGrid) + + for (const key in response.data) { + if (Object.prototype.hasOwnProperty.call(response.data, key)) { + tool.data.set(key, response.data[key]); + } + } + var menu = router.sc_getMenu(); var menuRouter = filterAsyncRouter(menu) menuRouter = flatAsyncRoutes(menuRouter) @@ -103,7 +106,7 @@ router.onError((error) => { //入侵追加自定义方法、对象 router.sc_getMenu = () => { var apiMenu = tool.data.get("menu") || [] - let userInfo = tool.data.get("userinfo") || {} + let userInfo = tool.data.get("user") || {} let userMenu = treeFilter(userRoutes, node => { return node.meta.role ? node.meta.role.filter(item => userInfo.role.indexOf(item) > -1).length > 0 : true }) diff --git a/src/utils/permission.js b/src/utils/permission.js index 4d49a4c..4ca0d06 100644 --- a/src/utils/permission.js +++ b/src/utils/permission.js @@ -42,7 +42,7 @@ export function permission(data) { } export function rolePermission(data) { - let userInfo = tool.data.get("userinfo"); + let userInfo = tool.data.get("user"); if(!userInfo){ return false; } diff --git a/src/views/home/index.vue b/src/views/home/index.vue index e02efb8..c317fe5 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -9,8 +9,8 @@ - - + + diff --git a/src/views/home/widgets/components/work.vue b/src/views/home/widgets/components/work.vue new file mode 100644 index 0000000..1312c7f --- /dev/null +++ b/src/views/home/widgets/components/work.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/src/views/home/widgets/index.vue b/src/views/home/widgets/index.vue index 79161f8..a581eb2 100644 --- a/src/views/home/widgets/index.vue +++ b/src/views/home/widgets/index.vue @@ -1,19 +1,14 @@