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