1. 去掉编译打包时为正确配置BannerPlugin
2. fes-core替换Icon组件
3. setDefaultPage改为直接跳转到defaultPage,而不是redirect
This commit is contained in:
万纯 2020-09-03 19:11:47 +08:00
parent 97655e3874
commit c3dbc26e64
13 changed files with 37 additions and 43 deletions

View File

@ -392,9 +392,9 @@ module.exports = function webpackConfig(configs, webpack, mode) {
return `chunk-${joinedHash}`; return `chunk-${joinedHash}`;
}), }),
/* config.plugin('Copyright') */ // /* config.plugin('Copyright') */
isBuild // isBuild
&& new webpack.BannerPlugin(''), // && new webpack.BannerPlugin(''),
/* config.plugin('case-sensitive-paths') */ /* config.plugin('case-sensitive-paths') */
new CaseSensitivePathsPlugin(), new CaseSensitivePathsPlugin(),

View File

@ -1,6 +1,6 @@
{ {
"name": "@webank/fes-cli", "name": "@webank/fes-cli",
"version": "0.1.2", "version": "0.1.3",
"description": "一个好用的前端管理台快速开发框架", "description": "一个好用的前端管理台快速开发框架",
"preferGlobal": true, "preferGlobal": true,
"scripts": { "scripts": {

View File

@ -11,18 +11,17 @@ module.exports = {
}, },
// 测试环境 --env=sit 触发使用 // 测试环境 --env=sit 触发使用
develop: { develop: {
api: '' api: 'http://test.xxx.com'
}, },
// 生产环境 --env=prod 触发使用 // 生产环境 --env=sit 触发使用
prod: { prod: {
api: '' api: 'http://xxx.com'
} }
}, },
// 配置角色-路由访问权限使用FesApp.setRole('unLogin')来修改当前用户的角色,控制路由访问权限 // 配置角色-路由访问权限使用FesApp.setRole('unLogin')来修改当前用户的角色,控制路由访问权限
roles: { roles: {
unLogin: ['/home'], unLogin: ['/home'],
service: ['/list', '/home'], admin: ['/list', '*']
admin: ['/list', '/api/fes']
}, },
// map // map
map: { map: {

View File

@ -52,6 +52,9 @@
"husky": "^3.0.9", "husky": "^3.0.9",
"lint-staged": "^9.4.2" "lint-staged": "^9.4.2"
}, },
"dependencies": {}, "dependencies": {
"@webank/fes-core": "^0.1.0",
"@webank/fes-ui": "^0.1.0"
},
"peerDependencies": {} "peerDependencies": {}
} }

View File

@ -3,9 +3,6 @@ import './assets/styles/main.scss';
export default function () { export default function () {
this.FesApp.set('FesName', '$i18n.title'); this.FesApp.set('FesName', '$i18n.title');
setTimeout(() => {
this.FesApp.setRole('admin', false);
}, 1000);
// 设置退出逻辑 // 设置退出逻辑
this.on('fes_logout', () => { this.on('fes_logout', () => {
@ -26,10 +23,10 @@ export default function () {
console.log(`您浏览到了${route.path}`); console.log(`您浏览到了${route.path}`);
}); });
// // 设置当前角色 // 设置当前角色
// if (!this.FesStorage.get('userLogin') === true) { if (!this.FesStorage.get('userLogin') === true) {
// this.setRole('unLogin') this.setRole('unLogin');
// } }
// 设置AJAX配置 // 设置AJAX配置
this.FesApi.option({ this.FesApi.option({

View File

@ -1,6 +1,6 @@
{ {
"name": "@webank/fes-core", "name": "@webank/fes-core",
"version": "0.1.0", "version": "0.1.1",
"description": "一个好用的前端管理台快速开发框架", "description": "一个好用的前端管理台快速开发框架",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"

View File

@ -205,10 +205,7 @@ class App {
async setDefaultPage() { async setDefaultPage() {
const defaultPage = await this.getDefaultPage(true); const defaultPage = await this.getDefaultPage(true);
this.router.addRoutes([{ this.router.push(defaultPage);
path: '/',
redirect: () => defaultPage
}]);
} }
async setRole(roleId, redirect = true, update = true) { async setRole(roleId, redirect = true, update = true) {

View File

@ -16,7 +16,7 @@
<p>{{fesFesx.FesRoleName}}</p> <p>{{fesFesx.FesRoleName}}</p>
</div> </div>
<div class="layout-left-user-logout"> <div class="layout-left-user-logout">
<Icon @click="logout" type="logout" size="24" /> <Icon @click="logout" type="md-log-out" size="28" />
</div> </div>
</div> </div>
</div> </div>

View File

@ -3,8 +3,14 @@
<div v-if="left" class="layout-left"> <div v-if="left" class="layout-left">
<left /> <left />
<span v-if="mode === 'vertical'" @click="toggleMenu" class="layout-left-fold-menu"> <span v-if="mode === 'vertical'" @click="toggleMenu" class="layout-left-fold-menu">
<Icon v-show="!leftHidden" type="double-left" /> <span v-show="!leftHidden">
<Icon v-show="leftHidden" type="double-right" /> <Icon type="ios-arrow-back" />
<Icon type="ios-arrow-back" />
</span>
<span v-show="leftHidden">
<Icon type="ios-arrow-forward" />
<Icon type="ios-arrow-forward" />
</span>
</span> </span>
</div> </div>
<div class="layout-right"> <div class="layout-right">

View File

@ -380,7 +380,6 @@ $dark-selected-color: #ffffff;
} }
.layout-left-user-name { .layout-left-user-name {
// flex: 1;
padding: 0 20px; padding: 0 20px;
p { p {
margin: 10px 0; margin: 10px 0;
@ -389,12 +388,12 @@ $dark-selected-color: #ffffff;
} }
.layout-left-user-logout { .layout-left-user-logout {
// flex: 1;
height: 70px; height: 70px;
line-height: 70px; line-height: 70px;
text-align: center; text-align: center;
.ui-icon-logout { .ui-icon {
cursor: pointer; cursor: pointer;
vertical-align: middle;
} }
} }

View File

@ -17,6 +17,3 @@
input[type=text]::-ms-clear { input[type=text]::-ms-clear {
display: none; display: none;
} }
.layout-left-user-logout i {
vertical-align: bottom;
}

View File

@ -11,18 +11,17 @@ module.exports = {
}, },
// 测试环境 --env=sit 触发使用 // 测试环境 --env=sit 触发使用
develop: { develop: {
api: 'http://h.adm-test.webank.io' api: 'http://test.xxx.com'
}, },
// 生产环境 --env=sit 触发使用 // 生产环境 --env=sit 触发使用
prod: { prod: {
api: 'http://adm.webank.io' api: 'http://xxx.com'
} }
}, },
// 配置角色-路由访问权限使用FesApp.setRole('unLogin')来修改当前用户的角色,控制路由访问权限 // 配置角色-路由访问权限使用FesApp.setRole('unLogin')来修改当前用户的角色,控制路由访问权限
roles: { roles: {
unLogin: ['/home'], unLogin: ['/home'],
service: ['/list', '/home'], admin: ['/list', '*']
admin: ['/list', '/api/fes']
}, },
// map // map
map: { map: {

View File

@ -3,9 +3,6 @@ import './assets/styles/main.scss';
export default function () { export default function () {
this.FesApp.set('FesName', '$i18n.title'); this.FesApp.set('FesName', '$i18n.title');
setTimeout(() => {
this.FesApp.setRole('admin', false);
}, 1000);
// 设置退出逻辑 // 设置退出逻辑
this.on('fes_logout', () => { this.on('fes_logout', () => {
@ -26,10 +23,10 @@ export default function () {
console.log(`您浏览到了${route.path}`); console.log(`您浏览到了${route.path}`);
}); });
// // 设置当前角色 // 设置当前角色
// if (!this.FesStorage.get('userLogin') === true) { if (!this.FesStorage.get('userLogin') === true) {
// this.setRole('unLogin') this.setRole('unLogin');
// } }
// 设置AJAX配置 // 设置AJAX配置
this.FesApi.option({ this.FesApi.option({