开发环境:
- Grails 1.3.4
- Acegi 0.5.3
- class-diagram 0.5.2
实现功能:
- 基于Acegi的权限管理框架
- 基于JQuery EasyUI 1.2的Tab布局
遇到的几个问题和收获:
1) 如何通过iframe新建TAB页
用户管理
这里的这个链接:"/matrix/user/list"花了我好长的时间,才知道在DEBUG环境下需要添加一个"/matrix"
function addTab(title, url){ if ($('#tt').tabs('exists', title)){ $('#tt').tabs('select', title); } else { var content = ''; $('#tt').tabs('add',{ title:title, content:content, closable:true }); } }
2) 权限系统初始化:
class BootStrap { def authenticateService = new AuthenticateService() def init = { servletContext -> new Role(authority: 'ROLE_ADMIN_USER', description: '系统管理员').save() new Role(authority: 'ROLE_USER', description: '普通用户').save() println "系统角色:" println Role.findAll() def user = new User( username: 'administrator', passwd: authenticateService.passwordEncoder("123456"), enabled:true, email:"[email protected]", userRealName:"热带翎羽", mobile:"18900000000", telephone:"0592100000" ) user.addToAuthorities(Role.findByAuthority("ROLE_ADMIN_USER")) user.save() user = new User( username: 'bruce', passwd: authenticateService.passwordEncoder("123456"), enabled:true, email:"[email protected]", userRealName:"热带翎羽", mobile:"18900000000", telephone:"0592100000" ) user.addToAuthorities(Role.findByAuthority("ROLE_USER")) user.save() println "系统预置用户:" println User.findAll() new RequestMap(url:"/user/*", configAttribute:"ROLE_ADMIN_USER").save() new RequestMap(url:"/role/*", configAttribute:"ROLE_ADMIN_USER").save() new RequestMap(url:"/requestmap/*", configAttribute:"ROLE_ADMIN_USER").save() println "权限映射:" println RequestMap.findAll() } def destroy = { } }
未解决的问题:
FORM的整体表现太“雷”人了,不知道如何优化一下,比如说:排版... 图标和圆角修饰