Commit f9988111b1b899298b962edbf9a26d54d0fa616f
1 parent
51b1efce
优化系统
Showing
6 changed files
with
35 additions
and
27 deletions
src/conf/config.js
| 1 | 1 | export default { |
| 2 | - baseUrl: 'http://localhost:9008', | |
| 3 | 2 | apiTimeout: 15000, |
| 4 | - lang: 'zh', | |
| 5 | - url: { | |
| 6 | - userLogin: "/home/login.pcUserLogin", | |
| 7 | - getCaptcha: "/home/user.getValidCode", | |
| 8 | - // 项目管理 | |
| 9 | - projectList: '/home/project.listProject', | |
| 10 | - projectAdd: '/home/project.saveProject', | |
| 11 | - projectUpdate: '/home/project.updateProject', | |
| 12 | - projectDelete: '/home/project.deleteProject', | |
| 13 | - | |
| 14 | - // 设备管理 | |
| 15 | - machineList: '/machine/list', | |
| 16 | - machineAdd: '/machine/add', | |
| 17 | - machineUpdate: '/machine/update', | |
| 18 | - machineDelete: '/machine/delete' | |
| 19 | - } | |
| 3 | + lang: 'zh',// zh 中文 en 英文 | |
| 20 | 4 | } | ... | ... |
src/i18n/index.js
| 1 | 1 | import Vue from 'vue' |
| 2 | 2 | import VueI18n from 'vue-i18n' |
| 3 | 3 | import ElementLocale from 'element-ui/lib/locale' |
| 4 | +import config from '@/conf/config' | |
| 4 | 5 | import { messages as loginMessages } from '../views/user/login/LoginLang' |
| 5 | 6 | import { messages as layoutMessages } from '../views/layout/LayoutLang' |
| 6 | 7 | import { messages as commonMessages } from './commonLang' |
| ... | ... | @@ -436,7 +437,7 @@ const messages = { |
| 436 | 437 | |
| 437 | 438 | // 创建 i18n 实例 |
| 438 | 439 | const i18n = new VueI18n({ |
| 439 | - locale: 'zh', | |
| 440 | + locale: config.lang, | |
| 440 | 441 | messages |
| 441 | 442 | }) |
| 442 | 443 | ... | ... |
src/router/index.js
| ... | ... | @@ -750,9 +750,9 @@ router.beforeEach((to, from, next) => { |
| 750 | 750 | } else { |
| 751 | 751 | let _title = to.meta.title; |
| 752 | 752 | if (!_title) { |
| 753 | - _title = '物业官网平台' | |
| 753 | + _title = '物业管理系统' | |
| 754 | 754 | } else { |
| 755 | - _title = _title + ' - 物业官网平台' | |
| 755 | + _title = _title + ' - 物业管理系统' | |
| 756 | 756 | } |
| 757 | 757 | document.title = _title |
| 758 | 758 | next() | ... | ... |
src/utils/request.js
src/views/layout/layout.vue
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | <!-- 顶部导航 --> |
| 4 | 4 | <el-header height="60px" class="app-header"> |
| 5 | 5 | <div class="header-left"> |
| 6 | - <div class="logo">HC</div> | |
| 6 | + <div class="logo">{{systemInfo.systemSimpleTitle}}</div> | |
| 7 | 7 | <el-menu mode="horizontal" :default-active="activeMenu" class="header-menu" background-color="#1e2132" |
| 8 | 8 | text-color="#fff" active-text-color="#409EFF"> |
| 9 | 9 | <el-menu-item :index="item.caId" v-for="(item, index) in catalogs" :key="index" |
| ... | ... | @@ -79,6 +79,7 @@ |
| 79 | 79 | <script> |
| 80 | 80 | import { _getMenuCatalog, getMenuTree, jumpToMall, jumpToIot } from '@/api/user/menuApi' |
| 81 | 81 | import { getStoreInfo } from "@/api/user/indexApi" |
| 82 | +import {listSystemInfo} from '@/api/system/systemInfoManageApi' | |
| 82 | 83 | import { deepCopy, setCurrentCommunity } from "@/utils/vc" |
| 83 | 84 | import { getCommunityName, _loadCommunityInfo } from '@/api/community/communityApi' |
| 84 | 85 | import moreCommunity from '@/components/community/moreCommunity.vue' |
| ... | ... | @@ -107,13 +108,17 @@ export default { |
| 107 | 108 | storeTypeCd: '', |
| 108 | 109 | storeId: '' |
| 109 | 110 | }, |
| 110 | - | |
| 111 | + systemInfo: { | |
| 112 | + systemSimpleTitle: '', | |
| 113 | + companyName: '', | |
| 114 | + logoUrl: '' | |
| 115 | + } | |
| 111 | 116 | } |
| 112 | 117 | }, |
| 113 | 118 | created() { |
| 114 | 119 | let _user = JSON.parse(localStorage.getItem('user')); |
| 115 | 120 | this.username = _user.name |
| 116 | - | |
| 121 | + this.getSystemInfo() | |
| 117 | 122 | this._loadStoreInfo() |
| 118 | 123 | this.loadCatalogs() |
| 119 | 124 | this.curCommunityName = getCommunityName() |
| ... | ... | @@ -126,6 +131,12 @@ export default { |
| 126 | 131 | searchCommunityDataList |
| 127 | 132 | }, |
| 128 | 133 | methods: { |
| 134 | + async getSystemInfo() { | |
| 135 | + const { data } = await listSystemInfo({ page: 1, row: 1 }); | |
| 136 | + this.systemInfo.systemSimpleTitle = data[0].systemSimpleTitle | |
| 137 | + this.systemInfo.companyName = data[0].companyName | |
| 138 | + this.systemInfo.logoUrl = data[0].logoUrl | |
| 139 | + }, | |
| 129 | 140 | async loadCommunity() { |
| 130 | 141 | const { communitys } = await _loadCommunityInfo() |
| 131 | 142 | this.communitys = communitys | ... | ... |
src/views/user/login/Login.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="login-container"> |
| 3 | 3 | <div class="login-card"> |
| 4 | - <div class="login-title">{{ $t('login.title') }}</div> | |
| 4 | + <div class="login-title" v-if="logo"> | |
| 5 | + <img :src="logo" alt="logo"> | |
| 6 | + </div> | |
| 5 | 7 | <el-form :model="loginForm" :rules="rules" ref="loginForm"> |
| 6 | 8 | <el-form-item prop="username"> |
| 7 | 9 | <el-input v-model="loginForm.username" :placeholder="$t('login.usernamePlaceholder')"></el-input> |
| ... | ... | @@ -22,7 +24,7 @@ |
| 22 | 24 | </el-form> |
| 23 | 25 | <!-- Add a white line and copyright info below the form --> |
| 24 | 26 | <div class="divider"></div> |
| 25 | - <div class="copyright">©2020-2025 java110团队</div> | |
| 27 | + <div class="copyright">©2020-2025 {{companyName}}</div> | |
| 26 | 28 | </div> |
| 27 | 29 | <select-login-user ref="selectLoginUserRef" @select="handleSelect"></select-login-user> |
| 28 | 30 | </div> |
| ... | ... | @@ -31,12 +33,16 @@ |
| 31 | 33 | <script> |
| 32 | 34 | import { login, getCaptcha, _loadStaffPrivileges } from '@/api/user/loginApi'; |
| 33 | 35 | import { _loadCommunityInfo } from '@/api/community/communityApi'; |
| 36 | +import {listSystemInfo} from '@/api/system/systemInfoManageApi' | |
| 34 | 37 | import selectLoginUser from '@/components/user/selectLoginUser.vue'; |
| 35 | 38 | |
| 39 | + | |
| 36 | 40 | export default { |
| 37 | 41 | name: 'Login', |
| 38 | 42 | data() { |
| 39 | 43 | return { |
| 44 | + logo: '', | |
| 45 | + companyName:'', | |
| 40 | 46 | loginForm: { |
| 41 | 47 | username: 'wuxw', |
| 42 | 48 | passwd: 'admin', |
| ... | ... | @@ -59,12 +65,19 @@ export default { |
| 59 | 65 | }, |
| 60 | 66 | created() { |
| 61 | 67 | localStorage.clear(); |
| 68 | + this.getSystemInfo() | |
| 62 | 69 | this.refreshCaptcha(); |
| 70 | + | |
| 63 | 71 | }, |
| 64 | 72 | components: { |
| 65 | 73 | selectLoginUser |
| 66 | 74 | }, |
| 67 | 75 | methods: { |
| 76 | + async getSystemInfo() { | |
| 77 | + const { data } = await listSystemInfo({ page: 1, row: 1 }); | |
| 78 | + this.logo = data[0].logoUrl | |
| 79 | + this.companyName = data[0].companyName | |
| 80 | + }, | |
| 68 | 81 | async submitForm(formName) { |
| 69 | 82 | this.$refs[formName].validate(async (valid) => { |
| 70 | 83 | if (valid) { |
| ... | ... | @@ -144,7 +157,6 @@ export default { |
| 144 | 157 | .login-card .login-title { |
| 145 | 158 | color: #fff; |
| 146 | 159 | text-align: center; |
| 147 | - margin-bottom: 20px; | |
| 148 | 160 | font-size: 48px; |
| 149 | 161 | } |
| 150 | 162 | ... | ... |