From 3edfaa7b9aea351883a8e6373fdc5b9ce8002d86 Mon Sep 17 00:00:00 2001 From: From-wh Date: Mon, 6 Mar 2023 18:13:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?improve:=20=E9=A6=96=E9=A1=B5=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-bread-crumb/custom-bread-crumb.vue | 2 +- .../admin/src/pages/account/login/index.vue | 28 +++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) 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; From d37668ef3c07cf5fb5fd4b6a8f1cc70b3c0172ce Mon Sep 17 00:00:00 2001 From: From-wh Date: Mon, 6 Mar 2023 18:14:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?style:=20vxe=E5=88=97=E8=A1=A8=E5=AD=97?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/admin/src/styles/style.css | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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; }