diff --git a/template/admin/src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.vue b/template/admin/src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.vue index e828afa04..18c842cbf 100644 --- a/template/admin/src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.vue +++ b/template/admin/src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.vue @@ -3,7 +3,7 @@ diff --git a/template/admin/src/pages/account/login/index.vue b/template/admin/src/pages/account/login/index.vue index a4d81ba44..dec304ab9 100644 --- a/template/admin/src/pages/account/login/index.vue +++ b/template/admin/src/pages/account/login/index.vue @@ -159,7 +159,7 @@ export default { swiperData() { loginInfoApi() .then((res) => { - window.document.title = `${res.data.site_name} - 登录` + window.document.title = `${res.data.site_name} - 登录`; localStorage.setItem('ADMIN_TITLE', res.data.site_name || ''); let data = res.data || {}; this.login_logo = data.login_logo ? data.login_logo : require('@/assets/images/logo.png'); @@ -239,8 +239,10 @@ export default { this.checkSocket(); } catch (e) {} - - return this.$router.replace({ path: res.data.menus[0].path || this.$routeProStr + '/' }); + // console.log(this.findFirstNonNullChildren(res.data.menus), 1111); + return this.$router.replace({ + path: this.findFirstNonNullChildren(res.data.menus).path || this.$routeProStr + '/', + }); }) .catch((res) => { msg(); @@ -252,6 +254,26 @@ export default { this.loading = false; }, 1000); }, + findFirstNonNullChildren(arr) { + // 如果数组为空,返回null + if (!arr || arr.length === 0) { + return null; + } + // 找到第一个对象 + const firstObj = arr[0]; + // 如果第一个对象没有children属性,返回该对象 + if (!firstObj.children) { + return firstObj; + } + + // 如果第一个对象的children属性是数组, + // 递归查找children属性中的第一个非null children属性 + if (Array.isArray(firstObj.children)) { + return this.findFirstNonNullChildren(firstObj.children); + } + // 如果数组中没有非null children属性,返回null + return null; + }, checkSocket() { getWorkermanUrl().then((res) => { let url = res.data.admin; diff --git a/template/admin/src/styles/style.css b/template/admin/src/styles/style.css index fb6026891..cd3ea6cae 100644 --- a/template/admin/src/styles/style.css +++ b/template/admin/src/styles/style.css @@ -3,6 +3,10 @@ .ivu-date-picker .ivu-select-dropdown { /* top: 33px!important; */ } +.vxe-tree-cell, +.vxe-cell { + font-size: 12px; +} .plusColor { color: #e83323; } @@ -204,7 +208,7 @@ body { } /*表格公共样式*/ -.ivu-table-header .ivu-table-cell{ +.ivu-table-header .ivu-table-cell { color: #999; font-size: 13px; padding: 10px 5px !important; @@ -519,7 +523,7 @@ body { padding: 10px 20px; border-bottom: 1px solid #f2f2f2; margin-bottom: 10px; - border-radius:5px; + border-radius: 5px; display: -webkit-box; display: -ms-flexbox; display: flex; @@ -542,11 +546,10 @@ body { overflow: auto; background-color: #f5f7f9; } -.left-wrapper{ +.left-wrapper { height: calc(100vh - 120px); background: #fff; border-right: 1px solid #f2f2f2; - } .ivu-tabs-bar { margin-bottom: 0; @@ -710,6 +713,6 @@ body { margin-top: 3px; color: rgb(153, 153, 153); } -.pt10{ +.pt10 { padding-top: 10px; }