优化代码

This commit is contained in:
wuxw 2022-08-20 00:11:29 +08:00
parent aa0f44a36f
commit 00912585cd
2 changed files with 36 additions and 32 deletions

View File

@ -24,12 +24,13 @@
<div class="carousel_div3"></div> <div class="carousel_div3"></div>
</div> </div>
<div class="login layui-anim layui-anim-up"> <div class="login layui-anim layui-anim-up">
<div class="layui-logo"> <div class="layui-logo" style="width: 300px;height:80px">
<a href="#" target="_blank"><img id="logoImg" width="300px" height="80px;" /></a> <!--<img class="java110-logo" width="300px" height="80px;" /> -->
<a href="#" target="_blank" class="java110-logo"></a>
</div> </div>
<fieldset class="layui-elem-field layui-field-title"> <fieldset class="layui-elem-field layui-field-title">
<legend class="text-white"> <legend class="text-white">
<vc:i18n name="subSystemName"></vc:i18n> <span class="java110-sub-system-name"></span>
</legend> </legend>
</fieldset> </fieldset>
<div id="component" class="layui-form" action="" method="post"> <div id="component" class="layui-form" action="" method="post">
@ -39,7 +40,8 @@
<div class="layui-footer text-white"> <div class="layui-footer text-white">
<!-- 底部固定区域 --> <!-- 底部固定区域 -->
&copy;2020-2023 &copy;2020-2023
<vc:i18n name="companyTeam"></vc:i18n> <span class="java110-company-team"></span>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
/** /**
* vcFramework * vcFramework
* *
* @author Kevin Law * @author 吴学文
* *
* @version 0.3 * @version 0.3
* *
@ -9,9 +9,9 @@
* *
* @time 2020-03-04 * @time 2020-03-04
* *
* @qq 58957118 * @qq 928255095
* *
* @mail 58957118@qq.com * @mail 928255095@qq.com
* *
*/ */
/** /**
@ -58,9 +58,9 @@
vcFramework = { vcFramework = {
version: "v0.0.3", version: "v0.0.3",
name: "vcFramework", name: "vcFramework",
author: 'Kevin Law', author: '吴学文',
email: '58957118@qq.com', email: '928255095@qq.com',
qq: '58957118', qq: '928255095',
description: 'vcFramework 是自研的一套组件开发套件', description: 'vcFramework 是自研的一套组件开发套件',
vueCache: _vueCache, vueCache: _vueCache,
vmOptions: _vmOptions, vmOptions: _vmOptions,
@ -1607,7 +1607,7 @@
}); });
} }
vcFramework.refreshSystemInfo = function(_callBack) { vcFramework.refreshSystemInfo = function() {
let param = { let param = {
params: { params: {
page: 1, page: 1,
@ -1621,38 +1621,42 @@
let _systemInfo = JSON.parse(json); let _systemInfo = JSON.parse(json);
if (_systemInfo.code != 0) { if (_systemInfo.code != 0) {
_callBack();
return; return;
} }
if (!_systemInfo.data || _systemInfo.data.length < 1) { if (!_systemInfo.data || _systemInfo.data.length < 1) {
_callBack();
return; return;
} }
let _data = _systemInfo.data[0]; let _data = _systemInfo.data[0];
if (!window.lang) {
return; document.title = _data.systemTitle;
let _logoImg = document.getElementsByClassName('java110-logo');
if (_logoImg && _logoImg.length>0) {
let _image = document.createElement('img')
_image.src = _data.logoUrl;
_image.style.width = "300px";
_image.style.height = "80px";
_logoImg[0].appendChild(_image);
} }
window.lang.systemName = _data.systemTitle; let _subSystemName = document.getElementsByClassName('java110-sub-system-name');
window.lang.subSystemName = _data.subSystemTitle; if(_subSystemName && _subSystemName.length>0){
window.lang.companyTeam = _data.companyName; _subSystemName[0].innerHTML = _data.subSystemTitle;
window.lang.systemSimpleName = _data.systemTitle;
window.lang.logoUrl = _data.logoUrl;
_callBack();
document.title = _data.systemTitle;
let _logoImg = document.getElementById('logoImg');
if (_logoImg) {
_logoImg.src = _data.logoUrl;
} }
let _companyTeam = document.getElementsByClassName('java110-company-team');
if(_companyTeam && _companyTeam.length>0){
_companyTeam[0].innerHTML = _data.companyName;
}
vc.saveData('java110SystemInfo', _data) vc.saveData('java110SystemInfo', _data)
}, },
function(errInfo, error) { function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');
_callBack();
}); });
} }
@ -2041,11 +2045,9 @@
* 框架开始初始化 * 框架开始初始化
*/ */
(function(vcFramework) { (function(vcFramework) {
vcFramework.refreshSystemInfo(function() {
//启动 框架 vcFramework.builderVcTree();
vcFramework.builderVcTree(); vcFramework.refreshSystemInfo();
});
})(window.vcFramework); })(window.vcFramework);
@ -2352,7 +2354,7 @@
* name:"Kevin", * name:"Kevin",
* age:"19", * age:"19",
* emailInfo:{ * emailInfo:{
* email:"58957118@qq.com" * email:"928255095@qq.com"
* } * }
* } * }
* *