├── .gitignore ├── .travis.yml ├── StartpointServer ├── .gitignore ├── WebContent │ ├── META-INF │ │ └── MANIFEST.MF │ ├── html │ │ ├── body.html │ │ ├── bottom.html │ │ ├── top.html │ │ ├── left.html │ │ ├── token.html │ │ ├── updateUserGroup.html │ │ ├── createUserGroup.html │ │ ├── updateUser.html │ │ └── user.html │ ├── WEB-INF │ │ ├── lib │ │ │ ├── log-1.0.0.jar │ │ │ ├── log4j-1.2.17.jar │ │ │ ├── commons-io-2.5.jar │ │ │ ├── ezmorph-1.0.6.jar │ │ │ ├── mariadb-1.0.0.jar │ │ │ ├── mybatis-3.4.2.jar │ │ │ ├── commons-lang-2.6.jar │ │ │ ├── httpserver-1.0.0.jar │ │ │ ├── slf4j-api-1.7.22.jar │ │ │ ├── commons-logging-1.2.jar │ │ │ ├── json-lib-2.4-jdk15.jar │ │ │ ├── protobuf-java-3.1.0.jar │ │ │ ├── slf4j-log4j12-1.7.22.jar │ │ │ ├── threadkeylock-1.0.0.jar │ │ │ ├── commons-beanutils-1.9.3.jar │ │ │ ├── commons-collections-3.2.2.jar │ │ │ ├── commons-fileupload-1.3.2.jar │ │ │ ├── javax.servlet-api-3.1.0.jar │ │ │ ├── mariadb-java-client-1.5.7.jar │ │ │ ├── protobuf-java-format-1.4.jar │ │ │ └── mybatis-generator-core-1.3.5.jar │ │ └── web.xml │ ├── js │ │ ├── app │ │ │ ├── Url.js │ │ │ ├── CookieName.js │ │ │ ├── NotificationExt.js │ │ │ ├── module │ │ │ │ ├── TopMediator.js │ │ │ │ ├── BottomMediator.js │ │ │ │ ├── TokenMediator.js │ │ │ │ ├── UpdateUserGroupMediator.js │ │ │ │ ├── CreateUserGroupMediator.js │ │ │ │ ├── UpdateUserMediator.js │ │ │ │ ├── BodyMediator.js │ │ │ │ ├── UserMediator.js │ │ │ │ └── LeftMediator.js │ │ │ ├── CookieParam.js │ │ │ ├── IndexMediator.js │ │ │ └── data │ │ │ │ └── http │ │ │ │ └── TokenProxy.js │ │ └── lib │ │ │ ├── juggle-help.min.js │ │ │ ├── juggle-module.min.js │ │ │ ├── juggle-help.js │ │ │ ├── juggle-http.min.js │ │ │ ├── juggle-mv.min.js │ │ │ ├── juggle-resource.min.js │ │ │ ├── juggle-module.js │ │ │ ├── juggle-event.min.js │ │ │ ├── jquery.cookie.js │ │ │ ├── juggle-http.js │ │ │ └── juggle-resource.js │ └── index.html ├── protobuf │ ├── protoc.exe │ ├── protobuf编译.bat │ └── UCErrorProto.proto ├── src │ ├── main │ │ └── java │ │ │ ├── StartpointServer.properties │ │ │ ├── org │ │ │ └── startpoint │ │ │ │ ├── config │ │ │ │ ├── UserGroupConfig.java │ │ │ │ ├── UserConfig.java │ │ │ │ └── CommonConfigUCenter.java │ │ │ │ ├── tool │ │ │ │ ├── StringUtil.java │ │ │ │ ├── PageObj.java │ │ │ │ ├── PageFormat.java │ │ │ │ └── TimeUtils.java │ │ │ │ ├── util │ │ │ │ └── IdUtil.java │ │ │ │ ├── keylock │ │ │ │ └── UCenterKeyLockType.java │ │ │ │ ├── dao │ │ │ │ ├── ext │ │ │ │ │ └── UserGroupMapperExt.java │ │ │ │ └── base │ │ │ │ │ ├── UserMapper.java │ │ │ │ │ ├── TokenMapper.java │ │ │ │ │ └── UserGroupMapper.java │ │ │ │ ├── log │ │ │ │ ├── MyAppender.java │ │ │ │ ├── HttpLog.java │ │ │ │ ├── KeylockLog.java │ │ │ │ └── MariadbLog.java │ │ │ │ ├── model │ │ │ │ └── ext │ │ │ │ │ └── UserGroupExt.java │ │ │ │ ├── action │ │ │ │ └── UCErrorPack.java │ │ │ │ ├── http │ │ │ │ └── filter │ │ │ │ │ └── TokenHttpFilter.java │ │ │ │ ├── mappers │ │ │ │ └── ext │ │ │ │ │ └── UserGroupMapperExt.xml │ │ │ │ ├── plugin │ │ │ │ └── PaginationPlugin.java │ │ │ │ └── server │ │ │ │ └── Expand.java │ │ │ └── generatorConfig.xml │ └── test │ │ └── java │ │ └── org │ │ └── startpoint │ │ └── Test.java └── build-Server.xml ├── startpoint1.png ├── startpoint2.png ├── startpoint3.png ├── StartpointConfig ├── default.png └── mybatis-config.xml ├── StartpointClient ├── images │ ├── add.png │ ├── bg.png │ ├── bj1.png │ ├── pic.png │ ├── btn01.png │ ├── btn02.png │ ├── btn03.png │ ├── check.png │ ├── close.png │ ├── crumb.png │ ├── icon01.png │ ├── icon02.png │ ├── icon10.png │ ├── icon11.png │ ├── icon12.png │ ├── icon2.png │ ├── icon3.png │ ├── icon4.png │ ├── icon5.png │ ├── icon6.png │ ├── icon7.png │ ├── icon8.png │ ├── icon9.png │ ├── inp_01.png │ ├── inp_02.png │ ├── line.png │ ├── m_inp.png │ ├── photo.png │ ├── select.png │ ├── select_b.png │ ├── error_pwd.png │ ├── icon2_hover.png │ ├── layer_close.png │ ├── login_box2.png │ ├── login_btn.png │ ├── login_inp.png │ ├── login_pwd.png │ ├── login_user.png │ ├── pagination.png │ ├── user_photo.png │ └── select_repeat.png ├── js │ ├── lib │ │ ├── layer │ │ │ └── skin │ │ │ │ └── default │ │ │ │ ├── icon.png │ │ │ │ ├── icon-ext.png │ │ │ │ ├── loading-0.gif │ │ │ │ ├── loading-1.gif │ │ │ │ └── loading-2.gif │ │ ├── juggle-help.min.js │ │ ├── juggle-module.min.js │ │ ├── juggle-help.js │ │ ├── juggle-httpfilter.min.js │ │ ├── juggle-http.min.js │ │ ├── juggle-mv.min.js │ │ ├── juggle-resource.min.js │ │ ├── juggle-module.js │ │ ├── juggle-httpfilter.js │ │ ├── juggle-event.min.js │ │ ├── jquery.cookie.js │ │ ├── juggle-http.js │ │ └── juggle-resource.js │ └── app │ │ ├── CookieName.js │ │ ├── Url.js │ │ ├── CookieParam.js │ │ ├── UCErrorFilter.js │ │ ├── UCEventType.js │ │ ├── module │ │ ├── CreateGroupMediator.js │ │ ├── HeadMediator.js │ │ ├── CreateGroup1Mediator.js │ │ ├── UserInfoBoxMediator.js │ │ ├── CreateBoxMediator.js │ │ ├── EditBoxMediator.js │ │ └── RightMediator.js │ │ ├── NotificationExt.js │ │ ├── UCErrorMsg.js │ │ ├── data │ │ └── TokenProxy.js │ │ ├── IndexMediator.js │ │ ├── LoginMediator.js │ │ └── UserNode.js ├── html │ ├── right.html │ ├── createGroup.html │ ├── head.html │ ├── createGroup1.html │ ├── left.html │ ├── userInfoBox.html │ ├── userList.html │ ├── editBox.html │ └── createBox.html ├── css │ ├── pagination.css │ ├── reset.css │ ├── login.css │ ├── left.css │ ├── select.css │ └── index.css ├── login.html └── index.html ├── LICENSE ├── README.md └── startpoint.sql /.gitignore: -------------------------------------------------------------------------------- 1 | dist -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | install: ant -------------------------------------------------------------------------------- /StartpointServer/.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | .classpath 3 | .project 4 | build 5 | dist -------------------------------------------------------------------------------- /startpoint1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/startpoint1.png -------------------------------------------------------------------------------- /startpoint2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/startpoint2.png -------------------------------------------------------------------------------- /startpoint3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/startpoint3.png -------------------------------------------------------------------------------- /StartpointServer/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /StartpointConfig/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointConfig/default.png -------------------------------------------------------------------------------- /StartpointClient/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/add.png -------------------------------------------------------------------------------- /StartpointClient/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/bg.png -------------------------------------------------------------------------------- /StartpointClient/images/bj1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/bj1.png -------------------------------------------------------------------------------- /StartpointClient/images/pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/pic.png -------------------------------------------------------------------------------- /StartpointClient/images/btn01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/btn01.png -------------------------------------------------------------------------------- /StartpointClient/images/btn02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/btn02.png -------------------------------------------------------------------------------- /StartpointClient/images/btn03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/btn03.png -------------------------------------------------------------------------------- /StartpointClient/images/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/check.png -------------------------------------------------------------------------------- /StartpointClient/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/close.png -------------------------------------------------------------------------------- /StartpointClient/images/crumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/crumb.png -------------------------------------------------------------------------------- /StartpointClient/images/icon01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon01.png -------------------------------------------------------------------------------- /StartpointClient/images/icon02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon02.png -------------------------------------------------------------------------------- /StartpointClient/images/icon10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon10.png -------------------------------------------------------------------------------- /StartpointClient/images/icon11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon11.png -------------------------------------------------------------------------------- /StartpointClient/images/icon12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon12.png -------------------------------------------------------------------------------- /StartpointClient/images/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon2.png -------------------------------------------------------------------------------- /StartpointClient/images/icon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon3.png -------------------------------------------------------------------------------- /StartpointClient/images/icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon4.png -------------------------------------------------------------------------------- /StartpointClient/images/icon5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon5.png -------------------------------------------------------------------------------- /StartpointClient/images/icon6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon6.png -------------------------------------------------------------------------------- /StartpointClient/images/icon7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon7.png -------------------------------------------------------------------------------- /StartpointClient/images/icon8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon8.png -------------------------------------------------------------------------------- /StartpointClient/images/icon9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon9.png -------------------------------------------------------------------------------- /StartpointClient/images/inp_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/inp_01.png -------------------------------------------------------------------------------- /StartpointClient/images/inp_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/inp_02.png -------------------------------------------------------------------------------- /StartpointClient/images/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/line.png -------------------------------------------------------------------------------- /StartpointClient/images/m_inp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/m_inp.png -------------------------------------------------------------------------------- /StartpointClient/images/photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/photo.png -------------------------------------------------------------------------------- /StartpointClient/images/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/select.png -------------------------------------------------------------------------------- /StartpointClient/images/select_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/select_b.png -------------------------------------------------------------------------------- /StartpointServer/protobuf/protoc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/protobuf/protoc.exe -------------------------------------------------------------------------------- /StartpointClient/images/error_pwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/error_pwd.png -------------------------------------------------------------------------------- /StartpointClient/images/icon2_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/icon2_hover.png -------------------------------------------------------------------------------- /StartpointClient/images/layer_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/layer_close.png -------------------------------------------------------------------------------- /StartpointClient/images/login_box2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/login_box2.png -------------------------------------------------------------------------------- /StartpointClient/images/login_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/login_btn.png -------------------------------------------------------------------------------- /StartpointClient/images/login_inp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/login_inp.png -------------------------------------------------------------------------------- /StartpointClient/images/login_pwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/login_pwd.png -------------------------------------------------------------------------------- /StartpointClient/images/login_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/login_user.png -------------------------------------------------------------------------------- /StartpointClient/images/pagination.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/pagination.png -------------------------------------------------------------------------------- /StartpointClient/images/user_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/user_photo.png -------------------------------------------------------------------------------- /StartpointServer/WebContent/html/body.html: -------------------------------------------------------------------------------- 1 | 2 |
body
-------------------------------------------------------------------------------- /StartpointClient/images/select_repeat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/images/select_repeat.png -------------------------------------------------------------------------------- /StartpointServer/WebContent/html/bottom.html: -------------------------------------------------------------------------------- 1 | 2 |
-------------------------------------------------------------------------------- /StartpointServer/WebContent/html/top.html: -------------------------------------------------------------------------------- 1 | 2 |
top
3 | -------------------------------------------------------------------------------- /StartpointClient/js/lib/layer/skin/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/js/lib/layer/skin/default/icon.png -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/log-1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/log-1.0.0.jar -------------------------------------------------------------------------------- /StartpointClient/js/lib/layer/skin/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/js/lib/layer/skin/default/icon-ext.png -------------------------------------------------------------------------------- /StartpointClient/js/lib/layer/skin/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/js/lib/layer/skin/default/loading-0.gif -------------------------------------------------------------------------------- /StartpointClient/js/lib/layer/skin/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/js/lib/layer/skin/default/loading-1.gif -------------------------------------------------------------------------------- /StartpointClient/js/lib/layer/skin/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointClient/js/lib/layer/skin/default/loading-2.gif -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/log4j-1.2.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/log4j-1.2.17.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/commons-io-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/commons-io-2.5.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/ezmorph-1.0.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/ezmorph-1.0.6.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/mariadb-1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/mariadb-1.0.0.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/mybatis-3.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/mybatis-3.4.2.jar -------------------------------------------------------------------------------- /StartpointClient/html/right.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |
6 | 7 |
-------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/commons-lang-2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/commons-lang-2.6.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/httpserver-1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/httpserver-1.0.0.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/slf4j-api-1.7.22.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/slf4j-api-1.7.22.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/json-lib-2.4-jdk15.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/json-lib-2.4-jdk15.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/protobuf-java-3.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/protobuf-java-3.1.0.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/slf4j-log4j12-1.7.22.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/slf4j-log4j12-1.7.22.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/threadkeylock-1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/threadkeylock-1.0.0.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/commons-beanutils-1.9.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/commons-beanutils-1.9.3.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/commons-collections-3.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/commons-collections-3.2.2.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/commons-fileupload-1.3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/commons-fileupload-1.3.2.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/javax.servlet-api-3.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/javax.servlet-api-3.1.0.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/mariadb-java-client-1.5.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/mariadb-java-client-1.5.7.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/protobuf-java-format-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/protobuf-java-format-1.4.jar -------------------------------------------------------------------------------- /StartpointServer/WebContent/WEB-INF/lib/mybatis-generator-core-1.3.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dianbaer/startpoint/HEAD/StartpointServer/WebContent/WEB-INF/lib/mybatis-generator-core-1.3.5.jar -------------------------------------------------------------------------------- /StartpointServer/protobuf/protobuf编译.bat: -------------------------------------------------------------------------------- 1 | d: 2 | cd D:\github\product\startpoint\StartpointServer\protobuf 3 | protoc --java_out=./ UCErrorProto.proto 4 | protoc --java_out=./ UserGroupProto.proto 5 | pause -------------------------------------------------------------------------------- /StartpointServer/src/main/java/StartpointServer.properties: -------------------------------------------------------------------------------- 1 | #mybatis-config.xml在服务器的地址 2 | config_dir = D:/github/product/startpoint/StartpointConfig 3 | #身份系统的地址,本项目的服务器地址 4 | uCenterUrl = http://localhost:8080/StartpointServer/s -------------------------------------------------------------------------------- /StartpointClient/js/app/CookieName.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var CookieName = function () { 4 | this.TOKEN = "token"; 5 | }; 6 | window.uca.cookieName = new CookieName(); 7 | })(window); -------------------------------------------------------------------------------- /StartpointClient/js/app/Url.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var Url = function () { 4 | this.ucUrl = "http://localhost:8080/StartpointServer/s"; 5 | }; 6 | window.uca.url = new Url(); 7 | })(window); -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/Url.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Url = function () { 4 | this.url = null; 5 | }; 6 | window.startpoint.url = new Url(); 7 | })(window); -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/CookieName.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var CookieName = function () { 4 | this.TOKEN = "token"; 5 | }; 6 | window.startpoint.cookieName = new CookieName(); 7 | })(window); -------------------------------------------------------------------------------- /StartpointServer/src/test/java/org/startpoint/Test.java: -------------------------------------------------------------------------------- 1 | package org.startpoint; 2 | 3 | import static org.junit.Assert.fail; 4 | 5 | public class Test { 6 | 7 | @org.junit.Test 8 | public void test() { 9 | fail("Not yet implemented"); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/config/UserGroupConfig.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.config; 2 | 3 | public class UserGroupConfig { 4 | public static int STATE_USABLE = 1; 5 | public static int STATE_DISABLED = 2; 6 | public static int STATE_DELETE = 3; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /StartpointClient/html/createGroup.html: -------------------------------------------------------------------------------- 1 | 2 |
创建用户组
3 |
4 |

用户组名称

5 | 6 | 保存 7 |
8 | 9 | -------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-help.min.js: -------------------------------------------------------------------------------- 1 | !function(n){n.juggle||(n.juggle={});n.juggle.tools=new function(){this.indexOf=function(n,u){var l=-1;if(null===n||null===u)return l;for(var i=0;i 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/dao/ext/UserGroupMapperExt.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.dao.ext; 2 | 3 | import java.util.List; 4 | 5 | import org.startpoint.model.ext.UserGroupExt; 6 | 7 | public interface UserGroupMapperExt { 8 | List selectByUserGroupParentId(String userGroupParentId); 9 | 10 | List selectTopUserGroup(); 11 | } -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/module/TopMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var TopMediator = function () { 5 | this.initView = function (view) { 6 | 7 | }; 8 | Mediator.apply(this); 9 | }; 10 | window.startpoint.TopMediator = TopMediator; 11 | })(window); -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/log/MyAppender.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.log; 2 | 3 | import org.apache.log4j.DailyRollingFileAppender; 4 | import org.apache.log4j.Priority; 5 | 6 | public class MyAppender extends DailyRollingFileAppender { 7 | @Override 8 | public boolean isAsSevereAsThreshold(Priority priority) { 9 | return this.getThreshold().equals(priority); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/module/BottomMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var BottomMediator = function () { 5 | this.initView = function (view) { 6 | 7 | }; 8 | Mediator.apply(this); 9 | }; 10 | window.startpoint.BottomMediator = BottomMediator; 11 | })(window); -------------------------------------------------------------------------------- /StartpointClient/html/head.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

用户管理中心

4 |
5 |
6 |
7 | 8 | 9 |
10 |
11 | 12 | 退出 13 |
14 |
15 |
16 |
17 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/html/token.html: -------------------------------------------------------------------------------- 1 | 2 |
test1 3 | 用户名:
4 | 密码:
5 |
6 | 7 |
8 | 9 |
10 |
-------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/config/UserConfig.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.config; 2 | 3 | public class UserConfig { 4 | public static int SEX_WOMAN = 1; 5 | public static int SEX_MAN = 2; 6 | public static int STATE_USABLE = 1; 7 | public static int STATE_DISABLED = 2; 8 | public static int STATE_DELETE = 3; 9 | 10 | public static int ROLE_MEMBER = 1; 11 | public static int ROLE_GROUP_MANAGER = 2; 12 | public static int ROLE_UCENTER_MANAGER = 3; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/model/ext/UserGroupExt.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.model.ext; 2 | 3 | import org.startpoint.model.base.UserGroup; 4 | 5 | public class UserGroupExt extends UserGroup { 6 | private static final long serialVersionUID = 1L; 7 | private Integer childrenNum; 8 | 9 | public Integer getChildrenNum() { 10 | return childrenNum; 11 | } 12 | 13 | public void setChildrenNum(Integer childrenNum) { 14 | this.childrenNum = childrenNum; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /StartpointClient/html/createGroup1.html: -------------------------------------------------------------------------------- 1 | 2 |
创建用户组
3 |
    4 |
  • 5 |

    上层用户组

    6 | 7 |
  • 8 |
  • 9 |

    用户组名称

    10 | 11 |
  • 12 |
  • 保存
  • 13 |
14 | 15 | -------------------------------------------------------------------------------- /StartpointClient/js/app/CookieParam.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var CookieParam = function () { 4 | this.getCookieParam = function (name) { 5 | return $.cookie(name); 6 | }; 7 | this.setCookieParam = function (name, value) { 8 | $.cookie(name, value); 9 | }; 10 | this.deleteCookieParam = function (name) { 11 | $.cookie(name, null); 12 | } 13 | }; 14 | window.uca.cookieParam = new CookieParam(); 15 | })(window); -------------------------------------------------------------------------------- /StartpointClient/js/app/UCErrorFilter.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var ucErrorMsg = window.uca.ucErrorMsg; 4 | var UCErrorFilter = function () { 5 | this.check = function (result) { 6 | if (result.hOpCode === "0") { 7 | alert(ucErrorMsg.errorMap[result.errorCode]); 8 | return false; 9 | } else { 10 | return true; 11 | } 12 | } 13 | }; 14 | window.uca.UCErrorFilter = UCErrorFilter; 15 | })(window); -------------------------------------------------------------------------------- /StartpointClient/css/pagination.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8";.pagination a{text-decoration:none;color:#666} 2 | .pagination a,.pagination span{display:inline-block;background:url(../images/pagination.png) 0 0 no-repeat;width:30px;height:30px;text-align:center;font-size:14px;color:#666;line-height:30px;margin:0 5px} 3 | .pagination a.next,.pagination a.prev{width:60px;background-position:-60px 0} 4 | .pagination .current{background-position:-30px 0;color:#fff} 5 | .pagination .current.next,.pagination .current.prev{color:#c4cae2;background-position:-60px 0;width:60px} 6 | -------------------------------------------------------------------------------- /StartpointClient/js/app/UCEventType.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var UCEventType = function () { 4 | this.OPEN_CHILDREN = "openChildren"; 5 | this.CHANGE_RIGHT = "changeRight"; 6 | this.CREATE_USER_GROUP = "createUserGroup"; 7 | this.DELETE_USER_GROUP = "deleteUserGroup"; 8 | this.UPDATE_USER = "updateUser"; 9 | this.DELETE_USER = "deleteUser"; 10 | this.USER_INFO = "userInfo"; 11 | }; 12 | window.uca.ucEventType = new UCEventType(); 13 | })(window); -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/config/CommonConfigUCenter.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.config; 2 | 3 | public class CommonConfigUCenter { 4 | 5 | public static long TOKEN_EXPIRE_TIME; 6 | public static String USER_IMG_DIR; 7 | // 用户中心url 8 | public static String UCENTER_URL; 9 | public static String CONFIG_DIR; 10 | 11 | public static void init() { 12 | 13 | TOKEN_EXPIRE_TIME = 3600000; 14 | USER_IMG_DIR = "IdentityUserImgDir"; 15 | UCENTER_URL = "http://localhost:8080/StartpointServer/s"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/CookieParam.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var CookieParam = function () { 4 | this.getCookieParam = function (name) { 5 | return $.cookie(name); 6 | }; 7 | this.setCookieParam = function (name, value) { 8 | $.cookie(name, value); 9 | }; 10 | this.deleteCookieParam = function (name) { 11 | $.cookie(name, null); 12 | } 13 | }; 14 | window.startpoint.cookieParam = new CookieParam(); 15 | })(window); -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/tool/PageObj.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.tool; 2 | 3 | public class PageObj { 4 | public int start; 5 | public int end; 6 | public int allNum; 7 | public int totalPage; 8 | public int currentPage; 9 | public int pageSize; 10 | 11 | public PageObj(int start, int end, int allNum, int totalPage, int currentPage, int pageSize) { 12 | this.start = start; 13 | this.end = end; 14 | this.allNum = allNum; 15 | this.totalPage = totalPage; 16 | this.currentPage = currentPage; 17 | this.pageSize = pageSize; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/action/UCErrorPack.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.action; 2 | 3 | import org.startpoint.http.HOpCodeUCenter; 4 | import org.startpoint.protobuf.http.UCErrorProto.UCError; 5 | import org.startpoint.protobuf.http.UCErrorProto.UCErrorCode; 6 | 7 | public class UCErrorPack { 8 | public static UCError create(UCErrorCode ucErrorCode, String errorHOpCode) { 9 | UCError.Builder errorBuilder = UCError.newBuilder(); 10 | errorBuilder.setHOpCode(HOpCodeUCenter.UC_ERROR); 11 | errorBuilder.setErrorCode(ucErrorCode); 12 | errorBuilder.setErrorHOpCode(errorHOpCode); 13 | return errorBuilder.build(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/html/updateUserGroup.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 用户组id:
4 | 用户组名:
5 | 是否修改用户父节点(0、1):
6 | 用户父节点:
7 | 用户状态(1、2、3):
8 |
9 | 10 | 用户组id:
11 | 12 | 13 |
-------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/log/HttpLog.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.log; 2 | 3 | import org.grain.log.ILog; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | public class HttpLog implements ILog { 8 | private Logger log; 9 | 10 | public HttpLog() { 11 | this.log = LoggerFactory.getLogger("httpLog"); 12 | } 13 | 14 | @Override 15 | public void warn(String warn) { 16 | this.log.warn(warn); 17 | 18 | } 19 | 20 | @Override 21 | public void error(String error, Throwable e) { 22 | this.log.error(error, e); 23 | 24 | } 25 | 26 | @Override 27 | public void info(String info) { 28 | this.log.info(info); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/log/KeylockLog.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.log; 2 | 3 | import org.grain.log.ILog; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | public class KeylockLog implements ILog { 8 | private Logger log; 9 | 10 | public KeylockLog() { 11 | this.log = LoggerFactory.getLogger("keylockLog"); 12 | } 13 | 14 | @Override 15 | public void warn(String warn) { 16 | this.log.warn(warn); 17 | 18 | } 19 | 20 | @Override 21 | public void error(String error, Throwable e) { 22 | this.log.error(error, e); 23 | 24 | } 25 | 26 | @Override 27 | public void info(String info) { 28 | this.log.info(info); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/log/MariadbLog.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.log; 2 | 3 | import org.grain.log.ILog; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | public class MariadbLog implements ILog { 8 | private Logger log; 9 | 10 | public MariadbLog() { 11 | this.log = LoggerFactory.getLogger("mariadbLog"); 12 | } 13 | 14 | @Override 15 | public void warn(String warn) { 16 | this.log.warn(warn); 17 | 18 | } 19 | 20 | @Override 21 | public void error(String error, Throwable e) { 22 | this.log.error(error, e); 23 | 24 | } 25 | 26 | @Override 27 | public void info(String info) { 28 | this.log.info(info); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/tool/PageFormat.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.tool; 2 | 3 | public class PageFormat { 4 | 5 | public static PageObj getStartAndEnd(int currentPage, int pageSize, int allNum) { 6 | if (pageSize < 1) { 7 | pageSize = allNum; 8 | } 9 | int totalPage = (int) Math.ceil(allNum / (pageSize + 0.0)); 10 | if (currentPage > totalPage) { 11 | currentPage = totalPage; 12 | } 13 | if (currentPage < 1) { 14 | currentPage = 1; 15 | } 16 | int start = (currentPage - 1) * pageSize; 17 | int end = (currentPage) * pageSize; 18 | if (end > allNum) { 19 | end = allNum; 20 | } 21 | return new PageObj(start, end, allNum, totalPage, currentPage, pageSize); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /StartpointClient/js/app/module/CreateGroupMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var userGroupProxy = window.uca.userGroupProxy; 5 | var notificationExt = window.uca.notificationExt; 6 | var CreateGroupMediator = function () { 7 | this.initView = function (view) { 8 | $("#createUserGroup").on("click", this.onCreateUserGroup); 9 | }; 10 | this.onCreateUserGroup = function () { 11 | var userGroupName = $("#userGroupName").val(); 12 | userGroupProxy.createUserGroup(userGroupName); 13 | }; 14 | Mediator.apply(this); 15 | }; 16 | window.uca.CreateGroupMediator = CreateGroupMediator; 17 | })(window); -------------------------------------------------------------------------------- /StartpointClient/html/left.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-module.min.js: -------------------------------------------------------------------------------- 1 | !function(e){e.juggle||(e.juggle={});var o=e.juggle.resourceManager;e.juggle.moduleManager=new function(){this.moduleUrlToData=[],this.moduleTypeToData=[],this.loadModule=function(e,t,a,i,l){var d={url:e,container:t,type:a,mediator:i,data:l};this.moduleUrlToData[e]=d,o.loadResource([e],this.loadComplete,this.loadFail,this)},this.loadFail=function(e){},this.loadComplete=function(e){var t=this.moduleUrlToData[e[0]];if(null!==t&&void 0!==t){var a=o.getResource(e[0]);if(null!==t.type&&void 0!==t.type){var i=this.moduleTypeToData[t.type];null!==i&&void 0!==i&&i.mediator.dispose(),this.moduleTypeToData[t.type]=t}t.container.innerHTML=a,t.mediator.initView(t.container,t.data)}},this.unLoadModule=function(e){var o=this.moduleUrlToData[e];null!==o&&void 0!==o&&(o.mediator.dispose(),delete this.moduleUrlToData[e],delete this.moduleTypeToData[o.type])}}}(window); -------------------------------------------------------------------------------- /StartpointServer/protobuf/UCErrorProto.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package org.startpoint.protobuf.http; 3 | message UCError{ 4 | string hOpCode=1; 5 | UCErrorCode errorCode=2; 6 | string errorHOpCode=3; 7 | string extraMsg=4; 8 | } 9 | enum UCErrorCode{ 10 | ERROR_CODE_0=0;//未知错误 11 | ERROR_CODE_1=1;//该token已过期或不合法 12 | ERROR_CODE_2=2;//该请求token不许为空 13 | ERROR_CODE_3=3;//该电话号码已被注册,添加用户失败 14 | ERROR_CODE_4=4;//不存在这个用户 15 | ERROR_CODE_5=5;//该用户已冻结或删除 16 | ERROR_CODE_6=6;//密码错误 17 | ERROR_CODE_7=7;//创建token失败 18 | ERROR_CODE_8=8;//延长token过期时间失败 19 | ERROR_CODE_9=9;//删除token失败 20 | ERROR_CODE_10=10;//创建用户组失败 21 | ERROR_CODE_11=11;//修改用户组失败 22 | ERROR_CODE_12=12;//获取用户组失败 23 | ERROR_CODE_13=13;//创建用户失败 24 | ERROR_CODE_14=14;//修改用户失败 25 | ERROR_CODE_15=15;//删除用户组失败 26 | ERROR_CODE_16=16;//获取admintoken失败 27 | ERROR_CODE_17=17;//你没有权限 28 | } -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/lib/juggle-module.min.js: -------------------------------------------------------------------------------- 1 | !function(e){e.juggle||(e.juggle={});var o=e.juggle.resourceManager;e.juggle.moduleManager=new function(){this.moduleUrlToData=[],this.moduleTypeToData=[],this.loadModule=function(e,t,a,i,l){var d={url:e,container:t,type:a,mediator:i,data:l};this.moduleUrlToData[e]=d,o.loadResource([e],this.loadComplete,this.loadFail,this)},this.loadFail=function(e){},this.loadComplete=function(e){var t=this.moduleUrlToData[e[0]];if(null!==t&&void 0!==t){var a=o.getResource(e[0]);if(null!==t.type&&void 0!==t.type){var i=this.moduleTypeToData[t.type];null!==i&&void 0!==i&&i.mediator.dispose(),this.moduleTypeToData[t.type]=t}t.container.innerHTML=a,t.mediator.initView(t.container,t.data)}},this.unLoadModule=function(e){var o=this.moduleUrlToData[e];null!==o&&void 0!==o&&(o.mediator.dispose(),delete this.moduleUrlToData[e],delete this.moduleTypeToData[o.type])}}}(window); -------------------------------------------------------------------------------- /StartpointClient/js/app/module/HeadMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var userProxy = window.uca.userProxy; 5 | var notificationExt = window.uca.notificationExt; 6 | var HeadMediator = function () { 7 | this.initView = function (view) { 8 | userProxy.getUser(); 9 | }; 10 | this.listNotificationInterests = [notificationExt.GET_USER_SUCCESS]; 11 | // 关心的消息处理 12 | this.handleNotification = function (data) { 13 | switch (data.name) { 14 | case notificationExt.GET_USER_SUCCESS: 15 | $("#head_userName").text("你好," + data.body.user.userName); 16 | break; 17 | } 18 | }; 19 | Mediator.apply(this); 20 | }; 21 | window.uca.HeadMediator = HeadMediator; 22 | })(window); -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/tool/TimeUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package org.startpoint.tool; 3 | 4 | import java.text.ParseException; 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | 8 | import org.grain.httpserver.HttpConfig; 9 | 10 | public class TimeUtils { 11 | public static SimpleDateFormat longDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 12 | 13 | public static String dateToString(Date date) { 14 | if (date == null) { 15 | return null; 16 | } 17 | return longDateFormat.format(date); 18 | } 19 | 20 | public static Date stringToDate(String time) { 21 | if (StringUtil.stringIsNull(time)) { 22 | return null; 23 | } 24 | Date date; 25 | try { 26 | date = longDateFormat.parse(time); 27 | return date; 28 | } catch (ParseException e) { 29 | HttpConfig.log.error("TimeUtils.stringToDate error", e); 30 | return null; 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/html/createUserGroup.html: -------------------------------------------------------------------------------- 1 | 2 |
test1 3 | 用户组名:
4 | 用户组父类id:
5 |
6 | 7 | 用户组id:
8 |
9 | 10 | 用户组父类id:
11 | 是否只查用户组父类id为空的:
12 | 是否递归:
13 | 用户组顶级id:
14 | 用户组状态(1、2、3):
15 | currentPage:
16 | pageSize(0不分页):
17 |
18 |
-------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-help.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.juggle) window.juggle = {}; 3 | var Tools = function () { 4 | /** 5 | * 判断数组里是否包含该对象 6 | * @param array 7 | * @param obj 8 | * @returns {number} 9 | */ 10 | this.indexOf = function (array, obj) { 11 | var index = -1; 12 | if (array === null || obj === null) { 13 | return index; 14 | } 15 | for (var i = 0; i < array.length; i++) { 16 | if (array[i] === obj) { 17 | index = i; 18 | break; 19 | } 20 | } 21 | return index; 22 | }; 23 | /** 24 | * 判断对象是否为空 25 | * @param obj 26 | * @returns {boolean} 27 | */ 28 | this.isNull = function (obj) { 29 | return obj === null || obj === undefined; 30 | } 31 | }; 32 | window.juggle.tools = new Tools(); 33 | })(window); -------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-httpfilter.min.js: -------------------------------------------------------------------------------- 1 | !function(l){l.juggle||(l.juggle={});var t=l.juggle.HttpClient,e=l.juggle.httpEventType;l.juggle.httpFilter=new function(){this.filterArray=[],this.addFilter=function(l){this.filterArray.push(l)},this.filter=function(l){for(var t=0;t 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
用户名:手机:
密码:邮箱:
真实姓名:创建时间:
性别:上次修改时间:
年龄:身份:
36 |
37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 电霸儿 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /StartpointClient/html/userList.html: -------------------------------------------------------------------------------- 1 | 2 |
用户组详情
3 |
    4 |
  • 5 |

    顶层用户组

    6 |

    7 |
  • 8 |
  • 9 |

    上层用户组

    10 |

    11 |
  • 12 |
  • 13 |

    增加时间

    14 |

    15 |
  • 16 |
  • 17 |

    修改时间

    18 |

    19 |
  • 20 |
21 |
用户列表
22 | 创建用户 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
头像用户名真实姓名手机身份操作
38 |
39 | 40 |
41 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/module/TokenMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var tokenProxy = window.startpoint.tokenProxy; 5 | var TokenMediator = function () { 6 | this.initView = function (view) { 7 | $("#getToken").on("click", this.onGetToken); 8 | $("#updateToken").on("click", this.onUpdateToken); 9 | $("#deleteToken").on("click", this.onDeleteToken); 10 | 11 | }; 12 | this.onGetToken = function (event) { 13 | var userName = $("#userName").val(); 14 | var userPassword = $("#userPassword").val(); 15 | 16 | tokenProxy.getToken(userName, userPassword); 17 | }; 18 | this.onUpdateToken = function (event) { 19 | 20 | tokenProxy.updateToken(); 21 | }; 22 | this.onDeleteToken = function (event) { 23 | 24 | tokenProxy.deleteToken(); 25 | }; 26 | Mediator.apply(this); 27 | }; 28 | window.startpoint.TokenMediator = TokenMediator; 29 | })(window); -------------------------------------------------------------------------------- /StartpointServer/WebContent/html/updateUser.html: -------------------------------------------------------------------------------- 1 | 2 |
test1 3 | 用户ID:
4 | 密码:
5 | 手机:
6 | 邮件:
7 | 状态(1、2、3):
8 | 是否修改用户组(1:修改,0不修改):
9 | 用户组id:
10 | 真实姓名:
11 | 性别(1、2):
12 | 年龄:
13 | 角色(1、2):
14 | 15 |
16 | 17 | 用户ID:
18 |
19 | 20 | 用户名:
21 |
22 |
-------------------------------------------------------------------------------- /StartpointClient/js/app/module/CreateGroup1Mediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var userGroupProxy = window.uca.userGroupProxy; 5 | var notificationExt = window.uca.notificationExt; 6 | var CreateGroup1Mediator = function () { 7 | this.userGroup = null; 8 | this.initView = function (view, userGroup) { 9 | this.userGroup = userGroup; 10 | $("#parentUserGroup").val(this.userGroup.userGroupName); 11 | this.addOnCreateUserGroup(this, this.onCreateUserGroup); 12 | }; 13 | this.addOnCreateUserGroup = function (obj, call) { 14 | var callFunc = function (event) { 15 | call.call(obj, event); 16 | }; 17 | $("#createUserGroup").on("click", callFunc); 18 | }; 19 | this.onCreateUserGroup = function (event) { 20 | var userGroupName = $("#userGroupName").val(); 21 | userGroupProxy.createUserGroup(userGroupName, this.userGroup.userGroupId); 22 | }; 23 | Mediator.apply(this); 24 | }; 25 | window.uca.CreateGroup1Mediator = CreateGroup1Mediator; 26 | })(window); -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/IndexMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var moduleManager = window.juggle.moduleManager; 5 | var TopMediator = window.startpoint.TopMediator; 6 | var LeftMediator = window.startpoint.LeftMediator; 7 | var BodyMediator = window.startpoint.BodyMediator; 8 | var BottomMediator = window.startpoint.BottomMediator; 9 | var IndexMediator = function () { 10 | this.initView = function (view) { 11 | // 模块 12 | moduleManager.loadModule("html/top.html", document.getElementById("index_top"), null, new TopMediator()); 13 | moduleManager.loadModule("html/left.html", document.getElementById("index_left"), null, new LeftMediator()); 14 | moduleManager.loadModule("html/body.html", document.getElementById("index_body"), null, new BodyMediator()); 15 | moduleManager.loadModule("html/bottom.html", document.getElementById("index_bottom"), null, new BottomMediator()); 16 | }; 17 | Mediator.apply(this); 18 | }; 19 | window.startpoint.IndexMediator = IndexMediator; 20 | })(window); -------------------------------------------------------------------------------- /StartpointClient/js/app/UCErrorMsg.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var UCErrorMsg = function () { 4 | this.errorMap = []; 5 | this.errorMap["ERROR_CODE_0"] = "未知错误"; 6 | this.errorMap["ERROR_CODE_1"] = "该token已过期或不合法"; 7 | this.errorMap["ERROR_CODE_2"] = "该请求token不许为空"; 8 | this.errorMap["ERROR_CODE_3"] = "该电话号码已被注册,添加用户失败"; 9 | this.errorMap["ERROR_CODE_4"] = "不存在这个用户"; 10 | this.errorMap["ERROR_CODE_5"] = "该用户已冻结或删除"; 11 | this.errorMap["ERROR_CODE_6"] = "密码错误"; 12 | this.errorMap["ERROR_CODE_7"] = "创建token失败"; 13 | this.errorMap["ERROR_CODE_8"] = "延长token过期时间失败"; 14 | this.errorMap["ERROR_CODE_9"] = "删除token失败"; 15 | this.errorMap["ERROR_CODE_10"] = "创建用户组失败"; 16 | this.errorMap["ERROR_CODE_11"] = "修改用户组失败"; 17 | this.errorMap["ERROR_CODE_12"] = "获取用户组失败"; 18 | this.errorMap["ERROR_CODE_13"] = "创建用户失败"; 19 | this.errorMap["ERROR_CODE_14"] = "修改用户失败"; 20 | this.errorMap["ERROR_CODE_15"] = "删除用户组失败"; 21 | this.errorMap["ERROR_CODE_16"] = "获取admintoken失败"; 22 | this.errorMap["ERROR_CODE_17"] = "你没有权限"; 23 | }; 24 | window.uca.ucErrorMsg = new UCErrorMsg(); 25 | })(window); -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/module/UpdateUserGroupMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var userGroupProxy = window.startpoint.userGroupProxy; 5 | var UpdateUserGroupMediator = function () { 6 | this.initView = function (view) { 7 | $("#updateUserGroup").on("click", this.onClick); 8 | $("#deleteUserGroup").on("click", this.onDeleteUserGroup); 9 | }; 10 | this.onClick = function (event) { 11 | var userGroupId = $("#userGroupId").val(); 12 | var userGroupName = $("#userGroupName").val(); 13 | var isUpdateUserGroupParent = $("#isUpdateUserGroupParent").val(); 14 | var userGroupParentId = $("#userGroupParentId").val(); 15 | var userGroupState = $("#userGroupState").val(); 16 | userGroupProxy.updateUserGroup(userGroupId, userGroupName, isUpdateUserGroupParent, userGroupParentId, userGroupState); 17 | }; 18 | this.onDeleteUserGroup = function (event) { 19 | var userGroupId = $("#userGroupIdDelete").val(); 20 | userGroupProxy.deleteUserGroup(userGroupId); 21 | }; 22 | Mediator.apply(this); 23 | }; 24 | window.startpoint.UpdateUserGroupMediator = UpdateUserGroupMediator; 25 | })(window); -------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-http.min.js: -------------------------------------------------------------------------------- 1 | !function(t){t.juggle||(t.juggle={});t.juggle.httpEventType=new function(){this.ERROR="error",this.SUCCESS="success"}}(window),function(t){t.juggle||(t.juggle={});var e=t.juggle.EventDispatcher,n=t.juggle.httpEventType;t.juggle.HttpClient=function(){e.apply(this),this.send=function(t,e,n,i,s){this.data=t,this.url=e,this.header=n;var u=new XMLHttpRequest;if(null===u||void 0===u)return!1;null!==s&&void 0!==s||(s=!0),null!==i&&void 0!==i||(i=null===t||void 0===t?"get":"post"),this.type=i,this.isAsync=s,u.open(i,e,s);for(var r in n)u.setRequestHeader(r,n[r]);this.addHttpListener(this,u,this.sendReturn,t),"post"===i?(u.setRequestHeader("Content-Type","application/json"),u.send(JSON.stringify(t))):u.send()},this.addHttpListener=function(t,e,n,i){e.onreadystatechange=function(s){n.call(t,e,s,i)}},this.sendReturn=function(t,e,i){4===t.readyState&&(200===t.status?this.dispatchEventWith(n.SUCCESS,!1,t.responseText):this.dispatchEventWith(n.ERROR))},this.sendFile=function(t,e,n,i,s,u){this.data=e,this.url=n,this.header=i;var r=new XMLHttpRequest;if(null===r||void 0===r)return!1;null!==u&&void 0!==u||(u=!0),null!==s&&void 0!==s||(s="post"),this.type=s,this.isAsync=u,r.open(s,n,u);for(var a in i)r.setRequestHeader(a,i[a]);this.addHttpListener(this,r,this.sendReturn,e);for(var d=new FormData,h=0;h 2 | 3 | StartpointServer 4 | 5 | 6 | InitHttpServer 7 | org.grain.httpserver.InitHttpServer 8 | 0 9 | 10 | 11 | 12 | InitHttpServer 13 | /s 14 | 15 | 16 | 17 | Expand 18 | org.startpoint.server.Expand 19 | 20 | 21 | 22 | ILog 23 | org.startpoint.log.HttpLog 24 | 25 | 26 | configFileName 27 | StartpointServer.properties 28 | 29 | 30 | index.html 31 | index.htm 32 | index.jsp 33 | default.html 34 | default.htm 35 | default.jsp 36 | 37 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/html/user.html: -------------------------------------------------------------------------------- 1 | 2 |
test1 3 | 用户名:
4 | 密码:
5 | 手机:
6 | 邮件:
7 | 用户组id:
8 | 真实姓名:
9 | 性别:
10 | 年龄:
11 | 角色(1、2):
12 | 13 |
14 | 用户id:
15 |
16 | 17 | 用户组id:
18 | 是否只查用户组id为空的:
19 | 是否递归:
20 | 用户状态(1、2、3):
21 | 用户性别(1、2):
22 | 用户角色(1、2):
23 | 用户组顶级id:
24 | 用户名模糊:
25 | 创建时间大于等于:
26 | 创建时间小于等于:
27 | currentPage:
28 | pageSize(0不分页):
29 |
30 |
-------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-resource.min.js: -------------------------------------------------------------------------------- 1 | !function(t){t.juggle||(t.juggle={}),t.juggle.resourceEventType=new function(){this.LOAD_COMPLETE="loadComplete",this.LOAD_FAIL="loadFail"}}(window),function(t){t.juggle||(t.juggle={});var e=t.juggle.EventDispatcher,i=t.juggle.HttpClient,s=t.juggle.httpEventType,a=t.juggle.resourceEventType;t.juggle.Loader=function(t,r){this.loadSuccess=function(t){this.resultArray[t.mTarget.url]=t.mData,++this.successNum+this.failNum===this.loadList.length&&(this.failNum>0?this.dispatchEventWith(a.LOAD_FAIL):this.dispatchEventWith(a.LOAD_COMPLETE))},this.loadError=function(t){this.failNum++,this.successNum+this.failNum===this.loadList.length&&this.dispatchEventWith(a.LOAD_FAIL)},this.loadList=t,this.resultArray=[],this.successNum=0,this.failNum=0,this.data=r,e.apply(this);for(var l=0;l0?this.dispatchEventWith(a.LOAD_FAIL):this.dispatchEventWith(a.LOAD_COMPLETE))},this.loadError=function(t){this.failNum++,this.successNum+this.failNum===this.loadList.length&&this.dispatchEventWith(a.LOAD_FAIL)},this.loadList=t,this.resultArray=[],this.successNum=0,this.failNum=0,this.data=r,e.apply(this);for(var l=0;limg{width:100%;height:auto} 10 | .login_main{width:1100px;margin:0 auto;position:relative} 11 | .login_logo{color:#fff;font-size:36px;padding-top:40px} 12 | .login_main>img{position:absolute;width:62%;height:auto;right:38%} 13 | .login_box{width:388px;height:392px;box-sizing:border-box;background:url(../images/login_box2.png) no-repeat center;overflow:hidden;padding:55px 40px 0 40px;position:absolute;right:0} 14 | .login_tit{font-size:22px;color:#fff} 15 | .form_box{height:120px} 16 | .login_inp_box{width:300px;height:40px;background:url(../images/login_inp.png) no-repeat center;position:relative;overflow:hidden} 17 | .login_icon{width:19px;height:22px;display:block;float:left;margin:9px 10px 9px 15px} 18 | .login_icon.user{background:url(../images/login_user.png) no-repeat center} 19 | .login_icon.pwd{background:url(../images/login_pwd.png) no-repeat center} 20 | .login_inp_box span{display:block;float:left;padding:12px 0;font-size:16px;color:#a5a5a5} 21 | .login_inp_box input{width:100%;height:40px;line-height:40px;color:#464646;box-sizing:border-box;padding-left:44px;position:absolute;z-index:99;top:0;left:0;background:0 0;border:none} 22 | .login_tips.wrong p{background:url(../images/error_pwd.png) left center no-repeat;padding-left:30px;line-height:20px;color:#fd2a51} 23 | .login_btn{display:block;width:300px;height:40px;background:url(../images/login_btn.png) center no-repeat;font-size:18px;color:#464646;text-align:center;line-height:40px} 24 | .login_footer{width:100%;height:50px;line-height:50px;background:#0e1121;color:#4d536a;text-align:center;position:fixed;bottom:0} 25 | -------------------------------------------------------------------------------- /StartpointClient/html/editBox.html: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
  • 4 |

    头像

    5 |
    6 | 7 |
    8 | 9 | 上传图片 10 |
    11 |
    12 |
  • 13 |
  • 14 |

    用户名

    15 | 16 | 请输入14字符以内的用户名 17 |
  • 18 |
  • 19 |

    身份

    20 | 24 |
  • 25 |
  • 26 |

    密码

    27 | 28 |
  • 29 |
  • 30 |

    年龄

    31 | 32 |
  • 33 |
  • 34 |

    真实姓名

    35 | 36 |
  • 37 |
  • 38 |

    手机

    39 | 40 |
  • 41 |
  • 42 |

    性别

    43 |
    44 |
    45 | 46 | 47 |
    48 |
    49 | 50 | 51 |
    52 |
    53 |
  • 54 |
  • 55 |

    邮箱

    56 | 57 |
  • 58 |
59 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/module/CreateUserGroupMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var userGroupProxy = window.startpoint.userGroupProxy; 5 | var CreateUserGroupMediator = function () { 6 | this.initView = function (view) { 7 | $("#createUserGroup").on("click", this.onCreateUserGroup); 8 | $("#getUserGroup").on("click", this.onGetUserGroup); 9 | $("#getUserGroupList").on("click", this.onGetUserGroupList); 10 | }; 11 | this.onCreateUserGroup = function (event) { 12 | var userGroupName = $("#userGroupName").val(); 13 | var userGroupParentId = $("#userGroupParentId").val(); 14 | userGroupProxy.createUserGroup(userGroupName, userGroupParentId); 15 | }; 16 | this.onGetUserGroup = function (event) { 17 | var userGroupId = $("#userGroupId").val(); 18 | userGroupProxy.getUserGroup(userGroupId); 19 | }; 20 | this.onGetUserGroupList = function (event) { 21 | var userGroupParentId = $("#userGroupParentId_list").val(); 22 | var isUserGroupParentIsNull = $("#isUserGroupParentIsNull_list").val(); 23 | var isRecursion = $("#isRecursion_list").val(); 24 | var userGroupTopId = $("#userGroupTopId_list").val(); 25 | var userGroupState = $("#userGroupState_list").val(); 26 | var currentPage = $("#currentPage").val(); 27 | var pageSize = $("#pageSize").val(); 28 | userGroupProxy.getUserGroupList(userGroupParentId, isUserGroupParentIsNull, isRecursion, userGroupTopId, userGroupState, currentPage, pageSize); 29 | }; 30 | Mediator.apply(this); 31 | }; 32 | window.startpoint.CreateUserGroupMediator = CreateUserGroupMediator; 33 | })(window); -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/module/UpdateUserMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var userProxy = window.startpoint.userProxy; 5 | var UpdateUserMediator = function () { 6 | this.initView = function (view) { 7 | $("#updateUser").on("click", this.onUpdateUser); 8 | $("#getUserImg").on("click", this.onGetUserImg); 9 | $("#checkUserName").on("click", this.onCheckUserName); 10 | }; 11 | this.onUpdateUser = function (event) { 12 | var userId = $("#userId").val(); 13 | var userPassword = $("#userPassword").val(); 14 | var userPhone = $("#userPhone").val(); 15 | var userEmail = $("#userEmail").val(); 16 | var userState = $("#userState").val(); 17 | var isUpdateUserGroup = $("#isUpdateUserGroup").val(); 18 | var userGroupId = $("#userGroupId").val(); 19 | var userRealName = $("#userRealName").val(); 20 | var userSex = $("#userSex").val(); 21 | var userAge = $("#userAge").val(); 22 | var userRole = $("#userRole").val(); 23 | var userImg = $("#userImg")[0].files; 24 | userProxy.updateUser(userId, userPassword, userPhone, userEmail, userState, isUpdateUserGroup, userGroupId, userRealName, userSex, userAge, userRole, userImg); 25 | }; 26 | this.onGetUserImg = function (event) { 27 | var userId = $("#userId_Img").val(); 28 | $("#userImgImg")[0].src = userProxy.getUserImg(userId); 29 | }; 30 | this.onCheckUserName = function (event) { 31 | var userName = $("#userName_check").val(); 32 | userProxy.checkUserByUserName(userName); 33 | }; 34 | Mediator.apply(this); 35 | }; 36 | window.startpoint.UpdateUserMediator = UpdateUserMediator; 37 | })(window); -------------------------------------------------------------------------------- /StartpointClient/html/createBox.html: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
  • 4 |

    头像

    5 |
    6 | 7 |
    8 | 9 | 上传图片 10 |
    11 |
    12 |
  • 13 |
  • 14 |

    用户名

    15 | 16 | 请输入14字符以内的用户名 17 |
  • 18 |
  • 19 |

    身份

    20 | 24 |
  • 25 |
  • 26 |

    密码

    27 | 28 |
  • 29 |
  • 30 |

    年龄

    31 | 32 |
  • 33 |
  • 34 |

    真实姓名

    35 | 36 |
  • 37 |
  • 38 |

    手机

    39 | 40 |
  • 41 |
  • 42 |

    性别

    43 |
    44 |
    45 | 46 | 47 |
    48 |
    49 | 50 | 51 |
    52 |
    53 |
  • 54 |
  • 55 |

    邮箱

    56 | 57 |
  • 58 |
59 | -------------------------------------------------------------------------------- /StartpointClient/js/app/module/UserInfoBoxMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var moduleManager = window.juggle.moduleManager; 5 | var UserInfoBoxMediator = function () { 6 | this.initView = function (view, user) { 7 | $("#userName_info").text(user.userName); 8 | $("#userPhone_info").text((user.userPhone === undefined ? "无" : user.userPhone)); 9 | $("#userEmail_info").text((user.userEmail === undefined ? "无" : user.userEmail)); 10 | $("#userRealName_info").text((user.userRealName === undefined ? "无" : user.userRealName)); 11 | $("#userCreateTime_info").text((user.userCreateTime === undefined ? "无" : user.userCreateTime)); 12 | $("#userSex_info").text((user.userSex === 1 ? "女" : "男")); 13 | $("#userUpdateTime_info").text((user.userUpdateTime === undefined ? "无" : user.userUpdateTime)); 14 | $("#userAge_info").text((user.userAge === undefined ? "无" : user.userAge)); 15 | $("#userRole_info").text((user.userRole === 1 ? "普通用户" : "企业管理员")); 16 | layer.open({ 17 | type: 1, 18 | content: $('.user_info_box'), 19 | title: "用户详情", 20 | area: ["870px", "400px"], 21 | skin: 'mySkin mySkin_zy', 22 | btn: "关闭", 23 | btn1: function (index, layero) { 24 | //关闭按钮 25 | 26 | //关闭弹窗 27 | layer.close(index); 28 | moduleManager.unLoadModule("html/userInfoBox.html"); 29 | }, 30 | btn2: function () { 31 | //取消按钮 32 | moduleManager.unLoadModule("html/userInfoBox.html"); 33 | }, 34 | cancel: function () { 35 | moduleManager.unLoadModule("html/userInfoBox.html"); 36 | } 37 | }); 38 | }; 39 | 40 | Mediator.apply(this); 41 | }; 42 | window.uca.UserInfoBoxMediator = UserInfoBoxMediator; 43 | })(window); -------------------------------------------------------------------------------- /StartpointServer/build-Server.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /StartpointClient/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 用户管理中心-登录 25 | 26 | 33 | 34 | 37 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /StartpointClient/js/app/IndexMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var notificationExt = window.uca.notificationExt; 5 | var moduleManager = window.juggle.moduleManager; 6 | var HeadMediator = window.uca.HeadMediator; 7 | var LeftMediator = window.uca.LeftMediator; 8 | var RightMediator = window.uca.RightMediator; 9 | var EditBoxMediator = window.uca.EditBoxMediator; 10 | var CreateBoxMediator = window.uca.CreateBoxMediator; 11 | var UserInfoBoxMediator = window.uca.UserInfoBoxMediator; 12 | var IndexMediator = function () { 13 | this.initView = function (view) { 14 | 15 | 16 | $(".detail li:last-child").addClass('nobr'); 17 | $(".left").css("minHeight", $(window).height() - 50); 18 | $(".left").css("height", $(document).height() - 50); 19 | 20 | moduleManager.loadModule("html/head.html", document.getElementById("index_head"), null, new HeadMediator()); 21 | moduleManager.loadModule("html/left.html", document.getElementById("index_left"), null, new LeftMediator()); 22 | moduleManager.loadModule("html/right.html", document.getElementById("index_right"), null, new RightMediator()); 23 | }; 24 | 25 | this.listNotificationInterests = [notificationExt.OPEN_BOX]; 26 | // 关心的消息处理 27 | this.handleNotification = function (data) { 28 | switch (data.name) { 29 | case notificationExt.OPEN_BOX: 30 | if (data.body.name === "editBox") { 31 | moduleManager.loadModule("html/editBox.html", document.getElementById("index_editbox"), null, new EditBoxMediator(), data.body.data); 32 | } else if (data.body.name === "createBox") { 33 | moduleManager.loadModule("html/createBox.html", document.getElementById("index_createbox"), null, new CreateBoxMediator(), data.body.data); 34 | } else if (data.body.name === "userInfoBox") { 35 | moduleManager.loadModule("html/userInfoBox.html", document.getElementById("index_userinfobox"), null, new UserInfoBoxMediator(), data.body.data); 36 | } 37 | break; 38 | } 39 | }; 40 | Mediator.apply(this); 41 | }; 42 | window.uca.IndexMediator = IndexMediator; 43 | })(window); 44 | -------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-module.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.juggle) window.juggle = {}; 3 | var resourceManager = window.juggle.resourceManager; 4 | var ModuleManager = function () { 5 | this.moduleUrlToData = []; 6 | this.moduleTypeToData = []; 7 | /** 8 | * 加载模块 9 | * @param url 地址 10 | * @param container 该模块容器 11 | * @param type 类型,如果已经该类型则将原模块卸载,加载新模块 12 | * @param mediator 模块控制器 13 | * @param data 额外数据 14 | */ 15 | this.loadModule = function (url, container, type, mediator, data) { 16 | var moduleData = { 17 | "url": url, 18 | "container": container, 19 | "type": type, 20 | "mediator": mediator, 21 | "data": data 22 | }; 23 | this.moduleUrlToData[url] = moduleData; 24 | resourceManager.loadResource([url], this.loadComplete, this.loadFail, this); 25 | }; 26 | this.loadFail = function (url) { 27 | 28 | }; 29 | this.loadComplete = function (url) { 30 | var moduleData = this.moduleUrlToData[url[0]]; 31 | //在未加载完成就卸载,会出现这种情况 32 | if (moduleData === null || moduleData === undefined) { 33 | return; 34 | } 35 | var resource = resourceManager.getResource(url[0]); 36 | if (moduleData.type !== null && moduleData.type !== undefined) { 37 | var oldModuleData = this.moduleTypeToData[moduleData.type]; 38 | if (oldModuleData !== null && oldModuleData !== undefined) { 39 | oldModuleData.mediator.dispose(); 40 | } 41 | this.moduleTypeToData[moduleData.type] = moduleData; 42 | } 43 | moduleData.container.innerHTML = resource; 44 | moduleData.mediator.initView(moduleData.container, moduleData.data); 45 | }; 46 | this.unLoadModule = function (url) { 47 | var moduleData = this.moduleUrlToData[url]; 48 | if (moduleData !== null && moduleData !== undefined) { 49 | moduleData.mediator.dispose(); 50 | delete this.moduleUrlToData[url]; 51 | delete this.moduleTypeToData[moduleData.type]; 52 | } 53 | } 54 | }; 55 | window.juggle.moduleManager = new ModuleManager(); 56 | })(window); -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/module/BodyMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var notificationExt = window.startpoint.notificationExt; 5 | var moduleManager = window.juggle.moduleManager; 6 | var CreateUserGroupMediator = window.startpoint.CreateUserGroupMediator; 7 | var UpdateUserGroupMediator = window.startpoint.UpdateUserGroupMediator; 8 | var UserMediator = window.startpoint.UserMediator; 9 | var UpdateUserMediator = window.startpoint.UpdateUserMediator; 10 | var TokenMediator = window.startpoint.TokenMediator; 11 | var BodyMediator = function () { 12 | this.initView = function (view) { 13 | moduleManager.loadModule("html/createUserGroup.html", document.getElementById("body"), "bodyview", new CreateUserGroupMediator()); 14 | }; 15 | 16 | // 关心消息数组 17 | this.listNotificationInterests = [notificationExt.CHANGE_BODY]; 18 | // 关心的消息处理 19 | this.handleNotification = function (data) { 20 | switch (data.name) { 21 | case notificationExt.CHANGE_BODY: 22 | if (data.body === "createUserGroup") { 23 | moduleManager.loadModule("html/createUserGroup.html", document.getElementById("body"), "bodyview", new CreateUserGroupMediator()); 24 | } else if (data.body === "updateUserGroup") { 25 | moduleManager.loadModule("html/updateUserGroup.html", document.getElementById("body"), "bodyview", new UpdateUserGroupMediator()); 26 | } else if (data.body === "User") { 27 | moduleManager.loadModule("html/user.html", document.getElementById("body"), "bodyview", new UserMediator()); 28 | } else if (data.body === "UpdateUser") { 29 | moduleManager.loadModule("html/updateUser.html", document.getElementById("body"), "bodyview", new UpdateUserMediator()); 30 | } else if (data.body === "Token") { 31 | moduleManager.loadModule("html/token.html", document.getElementById("body"), "bodyview", new TokenMediator()); 32 | } 33 | break; 34 | } 35 | }; 36 | Mediator.apply(this); 37 | }; 38 | window.startpoint.BodyMediator = BodyMediator; 39 | })(window); -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/lib/juggle-module.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.juggle) window.juggle = {}; 3 | var resourceManager = window.juggle.resourceManager; 4 | var ModuleManager = function () { 5 | this.moduleUrlToData = []; 6 | this.moduleTypeToData = []; 7 | /** 8 | * 加载模块 9 | * @param url 地址 10 | * @param container 该模块容器 11 | * @param type 类型,如果已经该类型则将原模块卸载,加载新模块 12 | * @param mediator 模块控制器 13 | * @param data 额外数据 14 | */ 15 | this.loadModule = function (url, container, type, mediator, data) { 16 | var moduleData = { 17 | "url": url, 18 | "container": container, 19 | "type": type, 20 | "mediator": mediator, 21 | "data": data 22 | }; 23 | this.moduleUrlToData[url] = moduleData; 24 | resourceManager.loadResource([url], this.loadComplete, this.loadFail, this); 25 | }; 26 | this.loadFail = function (url) { 27 | 28 | }; 29 | this.loadComplete = function (url) { 30 | var moduleData = this.moduleUrlToData[url[0]]; 31 | //在未加载完成就卸载,会出现这种情况 32 | if (moduleData === null || moduleData === undefined) { 33 | return; 34 | } 35 | var resource = resourceManager.getResource(url[0]); 36 | if (moduleData.type !== null && moduleData.type !== undefined) { 37 | var oldModuleData = this.moduleTypeToData[moduleData.type]; 38 | if (oldModuleData !== null && oldModuleData !== undefined) { 39 | oldModuleData.mediator.dispose(); 40 | } 41 | this.moduleTypeToData[moduleData.type] = moduleData; 42 | } 43 | moduleData.container.innerHTML = resource; 44 | moduleData.mediator.initView(moduleData.container, moduleData.data); 45 | }; 46 | this.unLoadModule = function (url) { 47 | var moduleData = this.moduleUrlToData[url]; 48 | if (moduleData !== null && moduleData !== undefined) { 49 | moduleData.mediator.dispose(); 50 | delete this.moduleUrlToData[url]; 51 | delete this.moduleTypeToData[moduleData.type]; 52 | } 53 | } 54 | }; 55 | window.juggle.moduleManager = new ModuleManager(); 56 | })(window); -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/http/filter/TokenHttpFilter.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.http.filter; 2 | 3 | import java.util.Date; 4 | 5 | import org.grain.httpserver.HttpException; 6 | import org.grain.httpserver.HttpPacket; 7 | import org.grain.httpserver.IHttpFilter; 8 | import org.startpoint.action.TokenAction; 9 | import org.startpoint.action.UCErrorPack; 10 | import org.startpoint.action.UserAction; 11 | import org.startpoint.http.HOpCodeUCenter; 12 | import org.startpoint.model.base.Token; 13 | import org.startpoint.model.base.User; 14 | import org.startpoint.protobuf.http.UCErrorProto.UCError; 15 | import org.startpoint.protobuf.http.UCErrorProto.UCErrorCode; 16 | 17 | public class TokenHttpFilter implements IHttpFilter { 18 | 19 | @Override 20 | public boolean httpFilter(HttpPacket httpPacket) throws HttpException { 21 | if (HOpCodeUCenter.GET_TOKEN.equals(httpPacket.hSession.headParam.hOpCode) || HOpCodeUCenter.GET_ADMIN_TOKEN.equals(httpPacket.hSession.headParam.hOpCode) || HOpCodeUCenter.CHECK_USER_BY_USER_NAME.equals(httpPacket.hSession.headParam.hOpCode) || HOpCodeUCenter.CHECK_USER_PHONE.equals(httpPacket.hSession.headParam.hOpCode)) { 22 | // 可以通过 23 | return true; 24 | } 25 | if (httpPacket.hSession.headParam.token == null) { 26 | // 不可以通过 27 | UCError errorPack = UCErrorPack.create(UCErrorCode.ERROR_CODE_2, httpPacket.hSession.headParam.hOpCode); 28 | throw new HttpException(HOpCodeUCenter.UC_ERROR, errorPack); 29 | } 30 | Token token = TokenAction.getTokenById(httpPacket.hSession.headParam.token); 31 | if (token == null) { 32 | UCError errorPack = UCErrorPack.create(UCErrorCode.ERROR_CODE_1, httpPacket.hSession.headParam.hOpCode); 33 | throw new HttpException(HOpCodeUCenter.UC_ERROR, errorPack); 34 | } 35 | Date date = new Date(); 36 | // token过期 37 | if (date.getTime() > token.getTokenExpireTime().getTime()) { 38 | TokenAction.deleteToken(token.getTokenId()); 39 | UCError errorPack = UCErrorPack.create(UCErrorCode.ERROR_CODE_1, httpPacket.hSession.headParam.hOpCode); 40 | throw new HttpException(HOpCodeUCenter.UC_ERROR, errorPack); 41 | } else { 42 | TokenAction.updateToken(token.getTokenId()); 43 | } 44 | User user = UserAction.getUserById(token.getUserId()); 45 | if (user == null) { 46 | UCError errorPack = UCErrorPack.create(UCErrorCode.ERROR_CODE_4, httpPacket.hSession.headParam.hOpCode); 47 | throw new HttpException(HOpCodeUCenter.UC_ERROR, errorPack); 48 | } 49 | httpPacket.hSession.otherData = user; 50 | return true; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/module/UserMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var userProxy = window.startpoint.userProxy; 5 | var UserMediator = function () { 6 | this.initView = function (view) { 7 | $("#createUser").on("click", this.onCreateUser); 8 | $("#getUser").on("click", this.onGetUser); 9 | $("#getUserList").on("click", this.onGetUserList); 10 | }; 11 | this.onCreateUser = function (event) { 12 | var userName = $("#userName").val(); 13 | var userPassword = $("#userPassword").val(); 14 | var userPhone = $("#userPhone").val(); 15 | var userEmail = $("#userEmail").val(); 16 | var userGroupId = $("#userGroupId").val(); 17 | var userRealName = $("#userRealName").val(); 18 | var userSex = $("#userSex").val(); 19 | var userAge = $("#userAge").val(); 20 | var userRole = $("#userRole").val(); 21 | var userImg = $("#userImg")[0].files; 22 | userProxy.createUser(userName, userPassword, userPhone, userEmail, userGroupId, userRealName, userSex, userAge, userRole, userImg); 23 | }; 24 | this.onGetUser = function (event) { 25 | var userId = $("#userId").val(); 26 | userProxy.getUser(userId); 27 | }; 28 | this.onGetUserList = function (event) { 29 | var userGroupId = $("#userGroupId_list").val(); 30 | var isUserGroupIsNull = $("#isUserGroupIsNull_list").val(); 31 | var isRecursion = $("#isRecursion_list").val(); 32 | var userState = $("#userState_list").val(); 33 | var userSex = $("#userSex_list").val(); 34 | var userRole = $("#userRole_list").val(); 35 | var userGroupTopId = $("#userGroupTopId_list").val(); 36 | var userName = $("#userName_list").val(); 37 | var userCreateTimeGreaterThan = $("#userCreateTimeGreaterThan").val(); 38 | var userCreateTimeLessThan = $("#userCreateTimeLessThan").val(); 39 | var currentPage = $("#currentPage").val(); 40 | var pageSize = $("#pageSize").val(); 41 | userProxy.getUserList(userGroupId, isUserGroupIsNull, isRecursion, userState, userSex, userRole, userGroupTopId, userName, userCreateTimeGreaterThan, userCreateTimeLessThan, currentPage, pageSize); 42 | }; 43 | Mediator.apply(this); 44 | }; 45 | window.startpoint.UserMediator = UserMediator; 46 | })(window); -------------------------------------------------------------------------------- /StartpointClient/js/app/module/CreateBoxMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var userProxy = window.uca.userProxy; 5 | var moduleManager = window.juggle.moduleManager; 6 | var CreateBoxMediator = function () { 7 | this.userGroupId = null; 8 | this.initView = function (view, userGroupId) { 9 | $('input').iCheck({ 10 | radioClass: 'iradio_square-blue' 11 | }); 12 | $("select").selectOrDie({ 13 | customClass: "m_select", 14 | }); 15 | //错误提示 16 | $(".error_msg").each(function () { 17 | if (!$(this).prev().hasClass('error_inp')) { 18 | $(this).prev().addClass('error_inp') 19 | } 20 | }); 21 | this.userGroupId = userGroupId; 22 | layer.open({ 23 | type: 1, 24 | content: $('.createBox'), 25 | title: "创建用户", 26 | area: ["870px", "550px"], 27 | skin: 'mySkin', 28 | btn: ["保存", "取消"], 29 | btn1: function (index, layero) { 30 | //保存按钮 31 | //关闭弹窗 32 | layer.close(index); 33 | var userImg = $("#create_userImg")[0].files; 34 | var userName = $("#create_userName").val(); 35 | var userRole = $("#create_userRole").val(); 36 | var userPassword = $("#create_userPassword").val(); 37 | var userAge = $("#create_userAge").val(); 38 | var userRealName = $("#create_userRealName").val(); 39 | var userPhone = $("#create_userPhone").val(); 40 | var userEmail = $("#create_userEmail").val(); 41 | var userSex = $("input[name='sex']:checked").val(); 42 | userProxy.createUser(userName, userPassword, userPhone, userEmail, userGroupId, userRealName, userSex, userAge, userRole, userImg); 43 | moduleManager.unLoadModule("html/createBox.html"); 44 | }, 45 | btn2: function () { 46 | //取消按钮 47 | moduleManager.unLoadModule("html/createBox.html"); 48 | }, 49 | cancel: function () { 50 | moduleManager.unLoadModule("html/createBox.html"); 51 | } 52 | }); 53 | 54 | }; 55 | Mediator.apply(this); 56 | }; 57 | window.uca.CreateBoxMediator = CreateBoxMediator; 58 | })(window); -------------------------------------------------------------------------------- /StartpointConfig/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-httpfilter.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.juggle) window.juggle = {}; 3 | var HttpClient = window.juggle.HttpClient; 4 | var httpEventType = window.juggle.httpEventType; 5 | var HttpFilter = function () { 6 | this.filterArray = []; 7 | this.addFilter = function (filter) { 8 | this.filterArray.push(filter); 9 | }; 10 | this.filter = function (result) { 11 | for (var i = 0; i < this.filterArray.length; i++) { 12 | var filter = this.filterArray[i]; 13 | var bool = filter.check(result); 14 | if (!bool) { 15 | return false; 16 | } 17 | } 18 | return true; 19 | }; 20 | this.send = function (data, url, header, type, isAsync, callObj, callSuccess, callError, callData) { 21 | var httpClient = new HttpClient(); 22 | httpClient.callObj = callObj; 23 | httpClient.callSuccess = callSuccess; 24 | httpClient.callError = callError; 25 | httpClient.callData = callData; 26 | httpClient.send(data, url, header, type, isAsync); 27 | httpClient.addEventListener(httpEventType.SUCCESS, this.successHandle, this); 28 | httpClient.addEventListener(httpEventType.ERROR, this.errorHandle, this); 29 | }; 30 | this.sendFile = function (fileList, data, url, header, type, isAsync, callObj, callSuccess, callError, callData) { 31 | var httpClient = new HttpClient(); 32 | httpClient.callObj = callObj; 33 | httpClient.callSuccess = callSuccess; 34 | httpClient.callError = callError; 35 | httpClient.callData = callData; 36 | httpClient.sendFile(fileList, data, url, header, type, isAsync); 37 | httpClient.addEventListener(httpEventType.SUCCESS, this.successHandle, this); 38 | httpClient.addEventListener(httpEventType.ERROR, this.errorHandle, this); 39 | }; 40 | this.successHandle = function (event) { 41 | var result = JSON.parse(event.mData); 42 | var httpClient = event.mTarget; 43 | var check = this.filter(result); 44 | if (check) { 45 | httpClient.callSuccess.call(httpClient.callObj, result, httpClient.callData); 46 | } else { 47 | httpClient.callError.call(httpClient.callObj, result, httpClient.callData); 48 | } 49 | 50 | }; 51 | this.errorHandle = function (event) { 52 | var httpClient = event.mTarget; 53 | httpClient.callError.call(httpClient.callObj, null, httpClient.callData); 54 | } 55 | }; 56 | window.juggle.httpFilter = new HttpFilter(); 57 | })(window); 58 | -------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-event.min.js: -------------------------------------------------------------------------------- 1 | !function(t){t.juggle||(t.juggle={});var n=t.juggle.tools;t.juggle.Event=function(t,e,i){this.mTarget=null,this.mCurrentTarget=null,this.mType=null,this.mBubbles=null,this.mStopsPropagation=null,this.mStopsImmediatePropagation=null,this.mData=null,this.stopPropagation=function(){this.mStopsPropagation=!0},this.stopImmediatePropagation=function(){this.mStopsPropagation=this.mStopsImmediatePropagation=!0},this.reset=function(t,e,i){return n.isNull(e)&&(e=!1),n.isNull(i)&&(i=null),this.mType=t,this.mBubbles=e,this.mData=i,this.mTarget=this.mCurrentTarget=null,this.mStopsPropagation=this.mStopsImmediatePropagation=!1,this},this.reset(t,e,i)}}(window),function(t){t.juggle||(t.juggle={});var n=t.juggle.Event;t.juggle.eventPool=new function(){this.sEventPool=[],this.fromPool=function(t,e,i){return this.sEventPool.length?this.sEventPool.pop().reset(t,e,i):new n(t,e,i)},this.toPool=function(t){t.mData=t.mTarget=t.mCurrentTarget=null,this.sEventPool[this.sEventPool.length]=t}}}(window),function(t){t.juggle||(t.juggle={});var n=t.juggle.eventPool,e=t.juggle.tools,i=[];t.juggle.EventDispatcher=function(){this.mEventListeners=null,this.isEventDispatcher=!0,this.functionMapping=[],this.addEventListener=function(t,n,i){e.isNull(this.mEventListeners)&&(this.mEventListeners=[]);var s=this.mEventListeners[t];e.isNull(s)?(this.mEventListeners[t]=[n],this.functionMapping[n]=i):-1===e.indexOf(s,n)&&(s.push(n),this.functionMapping[n]=i)},this.removeEventListener=function(t,n){if(this.mEventListeners){var e=this.mEventListeners[t],i=e?e.length:0;if(i>0){for(var s=0,o=[],l=0;l0?(n=i.pop())[0]=s:n=[s];!e.isNull(s=s.parent);)n[o++]=s;for(var l=0;l0){for(var s=0,o=[],l=0;l0?(n=i.pop())[0]=s:n=[s];!e.isNull(s=s.parent);)n[o++]=s;for(var l=0;l 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 52 | 53 |
54 |
55 |
56 |
57 |
58 |
59 | 60 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/generatorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 47 | 48 | 51 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 |
63 |
64 | 65 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/mappers/ext/UserGroupMapperExt.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | table_a.user_group_id as user_group_id, 16 | table_a.user_group_name as user_group_name, 17 | table_a.user_group_parent_id as user_group_parent_id, 18 | table_a.user_group_create_time as user_group_create_time, 19 | table_a.user_group_update_time as user_group_update_time, 20 | table_a.user_group_state as user_group_state, 21 | table_a.user_group_top_id as user_group_top_id, 22 | COUNT(table_b.user_group_state) as child_num 23 | 24 | 37 | 50 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/app/data/http/TokenProxy.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.startpoint) window.startpoint = {}; 3 | var Proxy = window.juggle.Proxy; 4 | var HttpClient = window.juggle.HttpClient; 5 | var httpEventType = window.juggle.httpEventType; 6 | var url = window.startpoint.url; 7 | var cookieName = window.startpoint.cookieName; 8 | var cookieParam = window.startpoint.cookieParam; 9 | var TokenProxy = function () { 10 | Proxy.apply(this); 11 | this.getToken = function (userName, userPassword) { 12 | var data = { 13 | "hOpCode": "23", 14 | "userName": userName, 15 | "userPassword": userPassword 16 | }; 17 | var header = []; 18 | header["hOpCode"] = "23"; 19 | var httpClient = new HttpClient(); 20 | httpClient.send(data, url.url, header); 21 | httpClient.addEventListener(httpEventType.SUCCESS, this.getTokenSuccess, this); 22 | httpClient.addEventListener(httpEventType.ERROR, this.getTokenFail, this); 23 | }; 24 | this.getTokenSuccess = function (event) { 25 | var returnData = JSON.parse(event.mData); 26 | cookieParam.setCookieParam(cookieName.TOKEN, returnData.tokenId); 27 | }; 28 | this.getTokenFail = function (event) { 29 | 30 | }; 31 | 32 | this.updateToken = function () { 33 | var data = { 34 | "hOpCode": "21" 35 | }; 36 | 37 | var header = []; 38 | header["hOpCode"] = "21"; 39 | header[cookieName.TOKEN] = cookieParam.getCookieParam(cookieName.TOKEN); 40 | var httpClient = new HttpClient(); 41 | httpClient.send(data, url.url, header); 42 | httpClient.addEventListener(httpEventType.SUCCESS, this.updateTokenSuccess, this); 43 | httpClient.addEventListener(httpEventType.ERROR, this.updateTokenFail, this); 44 | }; 45 | this.updateTokenSuccess = function (event) { 46 | 47 | }; 48 | this.updateTokenFail = function (event) { 49 | 50 | }; 51 | 52 | this.deleteToken = function () { 53 | var data = { 54 | "hOpCode": "22" 55 | }; 56 | 57 | var header = []; 58 | header["hOpCode"] = "22"; 59 | header[cookieName.TOKEN] = cookieParam.getCookieParam(cookieName.TOKEN); 60 | var httpClient = new HttpClient(); 61 | httpClient.send(data, url.url, header); 62 | httpClient.addEventListener(httpEventType.SUCCESS, this.deleteTokenSuccess, this); 63 | httpClient.addEventListener(httpEventType.ERROR, this.deleteTokenFail, this); 64 | }; 65 | this.deleteTokenSuccess = function (event) { 66 | 67 | }; 68 | this.deleteTokenFail = function (event) { 69 | 70 | } 71 | }; 72 | window.startpoint.tokenProxy = new TokenProxy(); 73 | })(window); -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/dao/base/UserMapper.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.dao.base; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import org.startpoint.model.base.User; 6 | import org.startpoint.model.base.UserCriteria; 7 | 8 | public interface UserMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table user 12 | * 13 | * @mbg.generated 14 | */ 15 | long countByExample(UserCriteria example); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table user 20 | * 21 | * @mbg.generated 22 | */ 23 | int deleteByExample(UserCriteria example); 24 | 25 | /** 26 | * This method was generated by MyBatis Generator. 27 | * This method corresponds to the database table user 28 | * 29 | * @mbg.generated 30 | */ 31 | int deleteByPrimaryKey(String userId); 32 | 33 | /** 34 | * This method was generated by MyBatis Generator. 35 | * This method corresponds to the database table user 36 | * 37 | * @mbg.generated 38 | */ 39 | int insert(User record); 40 | 41 | /** 42 | * This method was generated by MyBatis Generator. 43 | * This method corresponds to the database table user 44 | * 45 | * @mbg.generated 46 | */ 47 | int insertSelective(User record); 48 | 49 | /** 50 | * This method was generated by MyBatis Generator. 51 | * This method corresponds to the database table user 52 | * 53 | * @mbg.generated 54 | */ 55 | List selectByExample(UserCriteria example); 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table user 60 | * 61 | * @mbg.generated 62 | */ 63 | User selectByPrimaryKey(String userId); 64 | 65 | /** 66 | * This method was generated by MyBatis Generator. 67 | * This method corresponds to the database table user 68 | * 69 | * @mbg.generated 70 | */ 71 | int updateByExampleSelective(@Param("record") User record, @Param("example") UserCriteria example); 72 | 73 | /** 74 | * This method was generated by MyBatis Generator. 75 | * This method corresponds to the database table user 76 | * 77 | * @mbg.generated 78 | */ 79 | int updateByExample(@Param("record") User record, @Param("example") UserCriteria example); 80 | 81 | /** 82 | * This method was generated by MyBatis Generator. 83 | * This method corresponds to the database table user 84 | * 85 | * @mbg.generated 86 | */ 87 | int updateByPrimaryKeySelective(User record); 88 | 89 | /** 90 | * This method was generated by MyBatis Generator. 91 | * This method corresponds to the database table user 92 | * 93 | * @mbg.generated 94 | */ 95 | int updateByPrimaryKey(User record); 96 | } -------------------------------------------------------------------------------- /StartpointClient/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 用户管理中心 52 | 53 | 60 | 61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | 70 |
71 |
72 | 73 |
74 |
75 | 76 | 78 | 79 | -------------------------------------------------------------------------------- /StartpointClient/js/app/LoginMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var notificationExt = window.uca.notificationExt; 5 | var tokenProxy = window.uca.tokenProxy; 6 | var cookieName = window.uca.cookieName; 7 | var cookieParam = window.uca.cookieParam; 8 | var ucErrorMsg = window.uca.ucErrorMsg; 9 | var LoginMediator = function () { 10 | this.initView = function (view) { 11 | winSize(); 12 | $(".login_inp_box span").on("click", function () { 13 | $(this).siblings("input").focus() 14 | }); 15 | $(".login_inp_box input").focus(function () { 16 | $(this).siblings('span').hide(); 17 | }); 18 | $(".login_inp_box input").blur(function () { 19 | var $val = $(this).val(); 20 | if ($val.length == 0 || $val == "") { 21 | $(this).siblings('span').show(); 22 | } 23 | }); 24 | $(window).resize(function () { 25 | winSize() 26 | }); 27 | function winSize() { 28 | var $height = $(window).height(); 29 | $(".login_wrapper,.login_wrapper img").css({ 30 | "height": $height 31 | }); 32 | $(".login_main").css("height", $height - 50); 33 | var img_H = $(".login_main>img").height(); 34 | $(".login_main>img").css("top", ($height - img_H - 50) / 2 + 10); 35 | $(".login_box").css("top", ($height - 392) / 2); 36 | } 37 | 38 | $(".login_inp_box input").each(function () { 39 | var $val = $(this).val(); 40 | if ($val != "") { 41 | $(this).siblings('span').hide(); 42 | } 43 | }); 44 | $("#loginerror").hide(); 45 | $("#loginBtn").on("click", this.onLogin); 46 | }; 47 | 48 | this.onLogin = function (event) { 49 | $("#loginerror").hide(); 50 | var username = $("#username").val(); 51 | var password = $("#password").val(); 52 | tokenProxy.getToken(username, password); 53 | }; 54 | this.listNotificationInterests = [notificationExt.LOGIN_SUCCESS, notificationExt.LOGIN_FAIL]; 55 | // 关心的消息处理 56 | this.handleNotification = function (data) { 57 | switch (data.name) { 58 | case notificationExt.LOGIN_SUCCESS: 59 | cookieParam.setCookieParam(cookieName.TOKEN, data.body.tokenId); 60 | window.location.href = "index.html"; 61 | break; 62 | case notificationExt.LOGIN_FAIL: 63 | $("#loginerror").html('

' + ucErrorMsg.errorMap[data.body.errorCode] + '

'); 64 | $("#loginerror").show(); 65 | break; 66 | } 67 | }; 68 | Mediator.apply(this); 69 | }; 70 | window.uca.LoginMediator = LoginMediator; 71 | })(window); -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/dao/base/TokenMapper.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.dao.base; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import org.startpoint.model.base.Token; 6 | import org.startpoint.model.base.TokenCriteria; 7 | 8 | public interface TokenMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table token 12 | * 13 | * @mbg.generated 14 | */ 15 | long countByExample(TokenCriteria example); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table token 20 | * 21 | * @mbg.generated 22 | */ 23 | int deleteByExample(TokenCriteria example); 24 | 25 | /** 26 | * This method was generated by MyBatis Generator. 27 | * This method corresponds to the database table token 28 | * 29 | * @mbg.generated 30 | */ 31 | int deleteByPrimaryKey(String tokenId); 32 | 33 | /** 34 | * This method was generated by MyBatis Generator. 35 | * This method corresponds to the database table token 36 | * 37 | * @mbg.generated 38 | */ 39 | int insert(Token record); 40 | 41 | /** 42 | * This method was generated by MyBatis Generator. 43 | * This method corresponds to the database table token 44 | * 45 | * @mbg.generated 46 | */ 47 | int insertSelective(Token record); 48 | 49 | /** 50 | * This method was generated by MyBatis Generator. 51 | * This method corresponds to the database table token 52 | * 53 | * @mbg.generated 54 | */ 55 | List selectByExample(TokenCriteria example); 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table token 60 | * 61 | * @mbg.generated 62 | */ 63 | Token selectByPrimaryKey(String tokenId); 64 | 65 | /** 66 | * This method was generated by MyBatis Generator. 67 | * This method corresponds to the database table token 68 | * 69 | * @mbg.generated 70 | */ 71 | int updateByExampleSelective(@Param("record") Token record, @Param("example") TokenCriteria example); 72 | 73 | /** 74 | * This method was generated by MyBatis Generator. 75 | * This method corresponds to the database table token 76 | * 77 | * @mbg.generated 78 | */ 79 | int updateByExample(@Param("record") Token record, @Param("example") TokenCriteria example); 80 | 81 | /** 82 | * This method was generated by MyBatis Generator. 83 | * This method corresponds to the database table token 84 | * 85 | * @mbg.generated 86 | */ 87 | int updateByPrimaryKeySelective(Token record); 88 | 89 | /** 90 | * This method was generated by MyBatis Generator. 91 | * This method corresponds to the database table token 92 | * 93 | * @mbg.generated 94 | */ 95 | int updateByPrimaryKey(Token record); 96 | } -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/dao/base/UserGroupMapper.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.dao.base; 2 | 3 | import java.util.List; 4 | import org.apache.ibatis.annotations.Param; 5 | import org.startpoint.model.base.UserGroup; 6 | import org.startpoint.model.base.UserGroupCriteria; 7 | 8 | public interface UserGroupMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table user_group 12 | * 13 | * @mbg.generated 14 | */ 15 | long countByExample(UserGroupCriteria example); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table user_group 20 | * 21 | * @mbg.generated 22 | */ 23 | int deleteByExample(UserGroupCriteria example); 24 | 25 | /** 26 | * This method was generated by MyBatis Generator. 27 | * This method corresponds to the database table user_group 28 | * 29 | * @mbg.generated 30 | */ 31 | int deleteByPrimaryKey(String userGroupId); 32 | 33 | /** 34 | * This method was generated by MyBatis Generator. 35 | * This method corresponds to the database table user_group 36 | * 37 | * @mbg.generated 38 | */ 39 | int insert(UserGroup record); 40 | 41 | /** 42 | * This method was generated by MyBatis Generator. 43 | * This method corresponds to the database table user_group 44 | * 45 | * @mbg.generated 46 | */ 47 | int insertSelective(UserGroup record); 48 | 49 | /** 50 | * This method was generated by MyBatis Generator. 51 | * This method corresponds to the database table user_group 52 | * 53 | * @mbg.generated 54 | */ 55 | List selectByExample(UserGroupCriteria example); 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table user_group 60 | * 61 | * @mbg.generated 62 | */ 63 | UserGroup selectByPrimaryKey(String userGroupId); 64 | 65 | /** 66 | * This method was generated by MyBatis Generator. 67 | * This method corresponds to the database table user_group 68 | * 69 | * @mbg.generated 70 | */ 71 | int updateByExampleSelective(@Param("record") UserGroup record, @Param("example") UserGroupCriteria example); 72 | 73 | /** 74 | * This method was generated by MyBatis Generator. 75 | * This method corresponds to the database table user_group 76 | * 77 | * @mbg.generated 78 | */ 79 | int updateByExample(@Param("record") UserGroup record, @Param("example") UserGroupCriteria example); 80 | 81 | /** 82 | * This method was generated by MyBatis Generator. 83 | * This method corresponds to the database table user_group 84 | * 85 | * @mbg.generated 86 | */ 87 | int updateByPrimaryKeySelective(UserGroup record); 88 | 89 | /** 90 | * This method was generated by MyBatis Generator. 91 | * This method corresponds to the database table user_group 92 | * 93 | * @mbg.generated 94 | */ 95 | int updateByPrimaryKey(UserGroup record); 96 | } -------------------------------------------------------------------------------- /StartpointClient/css/left.css: -------------------------------------------------------------------------------- 1 | .nav_search{height:61px;box-sizing:border-box;border-bottom:1px solid #e0e1e5} 2 | .nav_search dl{height:61px;width:100%;position:relative} 3 | .nav_search dl dd{display:inline-block;vertical-align:top;box-sizing:border-box;height:60px} 4 | .searchAdd_P{padding-top:20px;width:100%;overflow:hidden;position:absolute;top:0;left:0;z-index:100;background:#f5f5f5} 5 | .addBtn_P{display:inline-block;padding-left:28px;height:18px;padding-right:10px;font-size:14px;color:#333;font-weight:700;background:url(../images/icon4.png) no-repeat left center;margin-left:86px;width:80px;float:left;line-height:18px} 6 | .searchIcon_P{display:inline-block;width:18px;height:18px;background:url(../images/icon3.png) no-repeat center center;cursor:pointer;float:right;position:relative;margin-right:20px;top:2px} 7 | .searchSer_P{width:100%;height:60px;box-sizing:border-box;padding-top:12px;position:absolute;top:0;left:0;z-index:10} 8 | .searchSer_P .searchIon2_P{display:inline-block;width:10px;height:18px;background:url(../images/icon11.png) no-repeat center center;vertical-align:top;margin-left:16px;position:relative;top:10px;margin-right:10px;cursor:pointer} 9 | .searchBox_P{display:inline-block;height:38px;width:210px;background:url(../images/icon9.png) no-repeat center center;vertical-align:top;box-sizing:border-box;padding:10px 12px 0 12px} 10 | .btnIcon_P{display:inline-block;vertical-align:top;width:18px;height:18px;background:url(../images/icon10.png) no-repeat center center;cursor:pointer} 11 | .myInput_P{border:none;outline:0;font-size:14px;color:#959fb1;width:145px;line-height:18px;height:18px;padding:0 5px;position:relative;top:1px;background-color:#fff} 12 | .myInput_P::-webkit-input-placeholder{color:#959fb1;line-height:18px} 13 | .myInput_P::-moz-placeholder{color:#959fb1;line-height:18px} 14 | .myInput_P:-ms-input-placeholder{color:#959fb1;line-height:18px} 15 | .navList_P dd{width:100%;min-height:30px} 16 | .navList_P{min-width:270px} 17 | .navList_P dd a{display:inline-block;height:30px;line-height:30px;width:100%} 18 | .navList_P dd a i{display:inline-block;width:15px;height:30px;margin-right:5px;position:relative} 19 | .listIcon_P{display:inline-block;width:15px;height:30px;background:url(../images/icon5.png) no-repeat center center;margin-right:5px} 20 | .navList_P.style_P>dd>a{color:#333;vertical-align:top} 21 | .navList_P dd a{color:#787a7d;padding-left:10px;position:relative;box-sizing:border-box} 22 | .navList_P dd a>span{width:208px;display:inline-block;height:30px;line-height:30px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;vertical-align:top} 23 | .navList_P dl{display:none} 24 | .listWin_P{width:100%;border-top:1px solid #fff} 25 | .useBox_P{display:inline-block;float:right;position:relative;top:0;margin-right:5px;display:none;height:30px} 26 | .addIcon1_P{display:inline-block;width:12px;height:30px;background:url(../images/add.png) no-repeat center center} 27 | .delIcon1_P{display:inline-block;width:12px;height:30px;background:url(../images/close.png) no-repeat center center;margin-left:5px} 28 | .navList_P dd a:hover{background:#dfeff8} 29 | .navList_P dd a:hover .useBox_P{display:inline-block} 30 | .open .listIcon_P{background-image:url(../images/icon6.png)!important} 31 | .open.onSty_P .listIcon_P{background-image:url(../images/icon7.png)!important} 32 | .onSty_P .listIcon_P{background-image:url(../images/icon12.png)!important} 33 | .navList_P dd a.onSty_P{background:#398dee} 34 | .navList_P dd a.onSty_P span{color:#fff} 35 | -------------------------------------------------------------------------------- /StartpointClient/js/app/UserNode.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var EventDispatcher = window.juggle.EventDispatcher; 4 | var ucEventType = window.uca.ucEventType; 5 | var UserNode = function (data, parentView) { 6 | this.data = data; 7 | this.view = null; 8 | this.parentView = parentView; 9 | EventDispatcher.apply(this); 10 | this.initView = function () { 11 | var html = '
' + 12 | '' + 13 | '' + 14 | '' + 15 | '' + 16 | '' + 17 | '' + 21 | ''; 22 | this.view = $(html); 23 | this.parentView.append(this.view); 24 | }; 25 | this.init = function () { 26 | this.initView(); 27 | this.addOnUpdateUser(this, this.onUpdateUser); 28 | this.addOnDeleteUser(this, this.onDeleteUser); 29 | this.addOnUserInfo(this, this.onUserInfo); 30 | }; 31 | this.addOnUpdateUser = function (obj, call) { 32 | var callFunc = function (event) { 33 | call.call(obj, event); 34 | }; 35 | $("#" + this.data.userId + "_update").on("click", callFunc); 36 | }; 37 | this.addOnDeleteUser = function (obj, call) { 38 | var callFunc = function (event) { 39 | call.call(obj, event); 40 | }; 41 | $("#" + this.data.userId + "_del").on("click", callFunc); 42 | }; 43 | this.addOnUserInfo = function (obj, call) { 44 | var callFunc = function (event) { 45 | call.call(obj, event); 46 | }; 47 | $("#" + this.data.userId + "_info").on("click", callFunc); 48 | }; 49 | this.onUpdateUser = function (event) { 50 | this.dispatchEventWith(ucEventType.UPDATE_USER, true, this.data); 51 | }; 52 | this.onUserInfo = function (event) { 53 | this.dispatchEventWith(ucEventType.USER_INFO, true, this.data); 54 | }; 55 | this.onDeleteUser = function (event) { 56 | event.stopPropagation(); 57 | var self = this; 58 | layer.confirm('是否删除该用户', { 59 | title: "提示", 60 | btn: ['确定', '关闭'], 61 | skin: 'mySkin', 62 | area: ["540px", "300px;"], 63 | btn1: function (index, layero) { 64 | //关闭弹窗 65 | layer.close(index); 66 | self.dispatchEventWith(ucEventType.DELETE_USER, true, self.data); 67 | }, 68 | btn2: function () { 69 | //取消按钮 70 | } 71 | }) 72 | }; 73 | this.init(); 74 | }; 75 | window.uca.UserNode = UserNode; 76 | })(window); -------------------------------------------------------------------------------- /StartpointClient/js/app/module/EditBoxMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var userProxy = window.uca.userProxy; 5 | var moduleManager = window.juggle.moduleManager; 6 | var EditBoxMediator = function () { 7 | this.user = null; 8 | this.initView = function (view, user) { 9 | $('input').iCheck({ 10 | radioClass: 'iradio_square-blue' 11 | }); 12 | $("select").selectOrDie({ 13 | customClass: "m_select", 14 | }); 15 | //错误提示 16 | $(".error_msg").each(function () { 17 | if (!$(this).prev().hasClass('error_inp')) { 18 | $(this).prev().addClass('error_inp') 19 | } 20 | }); 21 | this.user = user; 22 | $("#userPhoto")[0].src = this.user.userImgUrl + "&t=" + new Date().getTime(); 23 | $("#userName").val(this.user.userName); 24 | if (this.user.userRole === 1) { 25 | $("#userRole").find("option[value='1']").attr("selected", 'selected') 26 | } else { 27 | $("#userRole").find("option[value='2']").attr("selected", 'selected') 28 | } 29 | $("select").selectOrDie('update') 30 | $("#userAge").val(this.user.userAge); 31 | $("#userRealName").val(this.user.userRealName); 32 | $("#userPhone").val(this.user.userPhone); 33 | $("#userEmail").val(this.user.userEmail); 34 | if (this.user.userSex === 1) { 35 | $("#female").attr("checked", "checked") 36 | } else { 37 | $("#male").attr("checked", "checked") 38 | } 39 | $('input').iCheck('update') 40 | 41 | layer.open({ 42 | type: 1, 43 | content: $('.editBox'), 44 | title: "用户修改", 45 | area: ["870px", "550px"], 46 | skin: 'mySkin', 47 | btn: ["保存", "取消"], 48 | btn1: function (index, layero) { 49 | //保存按钮 50 | 51 | //关闭弹窗 52 | layer.close(index); 53 | var userImg = $("#userImg")[0].files; 54 | var userRole = $("#userRole").val(); 55 | var userPassword = $("#userPassword").val(); 56 | var userAge = $("#userAge").val(); 57 | var userRealName = $("#userRealName").val(); 58 | var userPhone = $("#userPhone").val(); 59 | var userEmail = $("#userEmail").val(); 60 | var userSex = $("input[name='sex2']:checked").val(); 61 | if (userPassword === null || userPassword === undefined) { 62 | userPassword = null; 63 | } 64 | userProxy.updateUser(user.userId, userPassword, userPhone, userEmail, 0, 0, null, userRealName, userSex, userAge, userRole, userImg); 65 | moduleManager.unLoadModule("html/editBox.html"); 66 | }, 67 | btn2: function () { 68 | //取消按钮 69 | moduleManager.unLoadModule("html/editBox.html"); 70 | }, 71 | cancel: function () { 72 | moduleManager.unLoadModule("html/editBox.html"); 73 | } 74 | }); 75 | }; 76 | Mediator.apply(this); 77 | }; 78 | window.uca.EditBoxMediator = EditBoxMediator; 79 | })(window); -------------------------------------------------------------------------------- /StartpointClient/css/select.css: -------------------------------------------------------------------------------- 1 | .sod_select,.sod_select *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} 2 | .sod_select{display:inline-block;position:relative;line-height:1;width:200px;padding:15px 10px;border:3px solid #5e5e5e;background:#fff;color:#444;font-size:11px;font-weight:700;text-align:left;text-transform:uppercase;outline:0;outline-offset:-2px;cursor:default} 3 | .sod_select:after,.sod_select:before{content:"\25B2";position:absolute;right:10px;top:12px;font-size:7px} 4 | .sod_select:after{content:"\25BC";top:auto;bottom:12px} 5 | .sod_select.focus,.sod_select.open,.sod_select:hover{border-color:#000} 6 | .sod_select.open{color:#919191} 7 | .sod_select.focus{box-shadow:0 0 5px rgba(0,0,0,.2)} 8 | .sod_select.disabled{border-color:#828282;color:#b2b2b2;cursor:not-allowed} 9 | .sod_select .sod_label{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-right:15px} 10 | .sod_select .sod_list_wrapper{position:absolute;top:100%;left:0;display:none;height:auto;width:200px;margin:0 0 0 -3px;background:#fff;border:3px solid #000;border-top:none;color:#444;font-weight:300;z-index:1} 11 | .sod_select.open .sod_list_wrapper{display:block} 12 | .sod_select.disabled.open .sod_list_wrapper{display:none} 13 | .sod_select.above .sod_list_wrapper{top:auto;bottom:100%;border-top:3px solid #000;border-bottom:none} 14 | .sod_select .sod_list{display:block;overflow-y:auto;padding:0;margin:0} 15 | .sod_select .sod_option{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:relative;padding:10px 10px;list-style-type:none} 16 | .sod_select .sod_option.optgroup,.sod_select .sod_option.optgroup.disabled{background:inherit;color:#939393;font-size:10px;font-style:italic} 17 | .sod_select .sod_option.groupchild{padding-left:20px} 18 | .sod_select .sod_option.is-placeholder{display:none} 19 | .sod_select .sod_option.disabled{background:inherit;color:#ccc} 20 | .sod_select .sod_option.active{background:#f7f7f7;color:#333} 21 | .sod_select .sod_option.selected{font-weight:700;padding-right:25px} 22 | .sod_select .sod_option.selected:before{content:"";position:absolute;right:10px;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:inline-block;color:grey;height:9px;width:10px;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMTAgOSIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTAgOSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBmaWxsPSIjRDlEOUQ4IiBkPSJNNCw2LjdDMy42LDYuMywzLjUsNi4xLDMuMSw1LjdDMi42LDUuMiwyLDQuNiwxLjUsNC4xYy0wLjgtMC44LTIsMC40LTEuMiwxLjJjMC45LDAuOSwxLjksMS45LDIuOCwyLjgNCgkJYzAuNywwLjcsMS4zLDEsMiwwQzYuNyw2LDguMywzLjcsOS44LDEuNUMxMC41LDAuNSw5LTAuMyw4LjMsMC42bDAsMEM2LjcsMi45LDUuNyw0LjQsNCw2LjciLz4NCjwvZz4NCjwvc3ZnPg0K)} 23 | .sod_select.no_highlight .sod_option.selected{font-weight:300} 24 | .sod_select.no_highlight .sod_option.selected:before{display:none} 25 | .sod_select select{display:none!important} 26 | .sod_select.touch select{-webkit-appearance:menulist-button;position:absolute;top:0;left:0;display:block!important;height:100%;width:100%;opacity:0;z-index:1} 27 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/plugin/PaginationPlugin.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.plugin; 2 | 3 | import java.util.List; 4 | 5 | import org.mybatis.generator.api.CommentGenerator; 6 | import org.mybatis.generator.api.IntrospectedTable; 7 | import org.mybatis.generator.api.PluginAdapter; 8 | import org.mybatis.generator.api.ShellRunner; 9 | import org.mybatis.generator.api.dom.java.Field; 10 | import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; 11 | import org.mybatis.generator.api.dom.java.JavaVisibility; 12 | import org.mybatis.generator.api.dom.java.Method; 13 | import org.mybatis.generator.api.dom.java.Parameter; 14 | import org.mybatis.generator.api.dom.java.TopLevelClass; 15 | import org.mybatis.generator.api.dom.xml.Attribute; 16 | import org.mybatis.generator.api.dom.xml.TextElement; 17 | import org.mybatis.generator.api.dom.xml.XmlElement; 18 | 19 | public class PaginationPlugin extends PluginAdapter { 20 | 21 | @Override 22 | public boolean validate(List arg0) { 23 | return true; 24 | } 25 | 26 | @Override 27 | public boolean modelExampleClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) { 28 | addLimit(topLevelClass, introspectedTable, "limitStart"); 29 | addLimit(topLevelClass, introspectedTable, "pageSize"); 30 | return super.modelExampleClassGenerated(topLevelClass, introspectedTable); 31 | } 32 | 33 | private void addLimit(TopLevelClass topLevelClass, IntrospectedTable introspectedTable, String name) { 34 | 35 | CommentGenerator commentGenerator = context.getCommentGenerator(); 36 | Field field = new Field(); 37 | field.setVisibility(JavaVisibility.PROTECTED); 38 | field.setType(FullyQualifiedJavaType.getIntInstance()); 39 | field.setName(name); 40 | field.setInitializationString("-1"); 41 | commentGenerator.addFieldComment(field, introspectedTable); 42 | topLevelClass.addField(field); 43 | char c = name.charAt(0); 44 | String camel = Character.toUpperCase(c) + name.substring(1); 45 | Method method = new Method(); 46 | method.setVisibility(JavaVisibility.PUBLIC); 47 | method.setName("set" + camel); 48 | method.addParameter(new Parameter(FullyQualifiedJavaType.getIntInstance(), name)); 49 | method.addBodyLine("this." + name + "=" + name + ";"); 50 | commentGenerator.addGeneralMethodComment(method, introspectedTable); 51 | topLevelClass.addMethod(method); 52 | method = new Method(); 53 | method.setVisibility(JavaVisibility.PUBLIC); 54 | method.setReturnType(FullyQualifiedJavaType.getIntInstance()); 55 | method.setName("get" + camel); 56 | method.addBodyLine("return " + name + ";"); 57 | commentGenerator.addGeneralMethodComment(method, introspectedTable); 58 | topLevelClass.addMethod(method); 59 | } 60 | 61 | @Override 62 | public boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated(XmlElement element, IntrospectedTable introspectedTable) { 63 | XmlElement isNotNullElement = new XmlElement("if"); 64 | isNotNullElement.addAttribute(new Attribute("test", "limitStart != null and limitStart >=0")); 65 | isNotNullElement.addElement(new TextElement("limit ${limitStart} , ${pageSize}")); 66 | element.addElement(isNotNullElement); 67 | return super.sqlMapSelectByExampleWithoutBLOBsElementGenerated(element, introspectedTable); 68 | } 69 | 70 | public static void generate() { 71 | String config = PaginationPlugin.class.getClassLoader().getResource("generatorConfig.xml").getFile(); 72 | String[] arg = { "-configfile", config, "-overwrite" }; 73 | ShellRunner.main(arg); 74 | } 75 | 76 | public static void main(String[] args) { 77 | generate(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # startpoint 2 | 3 | [![Build Status](https://travis-ci.org/dianbaer/startpoint.svg?branch=master)](https://travis-ci.org/dianbaer/startpoint) 4 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/7169462c959c468294a867e327baaa31)](https://www.codacy.com/app/232365732/startpoint?utm_source=github.com&utm_medium=referral&utm_content=dianbaer/startpoint&utm_campaign=Badge_Grade) 5 | [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) 6 | 7 | 8 | # startpoint是一个身份系统,提供用户、树形结构组、token等API。 9 | 10 | 11 | ### StartpointServer(目录结构) 12 | 13 | |--src.main.java(服务器代码) 14 | |--StartpointServer.properties---------------配置文件(需要修改) 15 | |--generatorConfig.xml--------------------mybatis自动生成配置文件(重新生成时,需要修改) 16 | |--org.startpoint 17 | |--server.Expand.java-------------------扩展启动类 18 | |--plugin.PaginationPlugin.java-------mybatis自动生成配置文件启动类 19 | 20 | |--protobuf(消息包生成工具) 21 | |--WebContent 22 | |--index.html(所有API示例,需要修改url) 23 | |--js(所有API示例依赖js) 24 | |--html(所有API示例依赖html) 25 | 26 | 27 | ### 接口调用界面示例 28 | 29 | >获取admintoken 30 | 31 | ![接口调用界面示例](./startpoint1.png "startpoint1.png") 32 | 33 | >创建顶级组 34 | 35 | ![接口调用界面示例](./startpoint2.png "startpoint2.png") 36 | 37 | >创建归属于组的用户 38 | 39 | ![接口调用界面示例](./startpoint3.png "startpoint3.png") 40 | 41 | 42 | ## 打版本:在项目根目录下,执行 43 | 44 | ant 45 | 46 | 47 | 48 | ## 推荐环境: 49 | 50 | >快捷部署 https://github.com/dianbaer/deployment-server 51 | 52 | jdk-8u121 53 | 54 | apache-tomcat-8.5.12 55 | 56 | MariaDB-10.1.22 57 | 58 | CentOS-7-1611 59 | 60 | 61 | ## 发布项目: 62 | 63 | >1、安装数据库 64 | 65 | create database startpoint 66 | 67 | source ****/startpoint.sql 68 | 69 | >2、将StartpointConfig放入服务器某个路径,例如 70 | 71 | /home/StartpointConfig 72 | 73 | >3、将StartpointServer.properties放入tomcat根目录下,例如 74 | 75 | /home/tomcat/StartpointServer.properties 76 | 77 | 并修改config_dir对应的StartpointConfig路径 78 | 79 | >4、将StartpointServer.war放入tomcat/webapps,例如 80 | 81 | /home/tomcat/webapps/StartpointServer.war 82 | 83 | 84 | 85 | 86 | ## startpoint提供的API功能(除了获取token接口请求外,其他接口需要传admintoken): 87 | 88 | 获取admintoken示例: 89 | 90 | var data = { 91 | 'hOpCode': '20', 92 | 'userName': 'admin', 93 | 'userPassword': '123456' 94 | }; 95 | var header = []; 96 | header["hOpCode"] = "20"; 97 | var httpClient = new juggle.HttpClient(); 98 | httpClient.send(data, "http://localhost:8080/StartpointServer/s", header); 99 | httpClient.addEventListener(juggle.httpEventType.SUCCESS, adminSuccess, this); 100 | httpClient.addEventListener(juggle.httpEventType.ERROR, adminError, this); 101 | 102 | 103 | >1、用户组API(树形结构): 104 | 105 | 创建、修改、获取、删除用户组。 106 | 获取用户组列表。 107 | 108 | >2、用户API: 109 | 110 | 创建、修改、获取用户。 111 | 获取用户列表。 112 | 根据邮箱获取用户、获取用户头像。 113 | 检查用户名、手机是否存在。 114 | 115 | >3、tokenAPI: 116 | 117 | 登录通过用户名密码获取token 118 | 更新token 119 | 删除token 120 | 121 | 122 | ### java服务器基于grain 123 | 124 | 依赖以下库,共(1841行,学习成本极低) 125 | 126 | grain-httpserver.jar(1318行) 127 | grain-log.jar(111行) 128 | grain-threadkeylock.jar(364行) 129 | grain-mariadb.jar(48行) 130 | 131 | 132 | github: 133 | 134 | 135 | https://github.com/dianbaer/grain 136 | 137 | 138 | 码云: 139 | 140 | 141 | https://gitee.com/dianbaer/grain 142 | 143 | 144 | ### js客户端基于juggle 145 | 146 | 最精简依赖以下库,共(653行,学习成本极低) 147 | 148 | juggle-help.js(33行) 149 | juggle-event.js(256行) 150 | juggle-http.js(99行) 151 | juggle-mv.js(104行) 152 | juggle-resource.js(105行) 153 | juggle-module.js(56行) 154 | 155 | github: 156 | 157 | 158 | https://github.com/dianbaer/juggle 159 | 160 | 161 | 码云: 162 | 163 | 164 | https://gitee.com/dianbaer/basic 165 | -------------------------------------------------------------------------------- /StartpointClient/js/lib/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (value !== undefined && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | -------------------------------------------------------------------------------- /StartpointClient/js/app/module/RightMediator.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.uca) window.uca = {}; 3 | var Mediator = window.juggle.Mediator; 4 | var moduleManager = window.juggle.moduleManager; 5 | var UserListMediator = window.uca.UserListMediator; 6 | var CreateGroup1Mediator = window.uca.CreateGroup1Mediator; 7 | var CreateGroupMediator = window.uca.CreateGroupMediator; 8 | var notificationExt = window.uca.notificationExt; 9 | var userGroupProxy = window.uca.userGroupProxy; 10 | var RightMediator = function () { 11 | this.nowState = "userList"; 12 | this.initView = function (view) { 13 | moduleManager.loadModule("html/userList.html", document.getElementById("right_content"), "right_content", new UserListMediator()); 14 | this.nowState = "userList"; 15 | }; 16 | this.listNotificationInterests = [notificationExt.CHANGE_RIGHT_CONTENT, notificationExt.GET_USER_GROUP_RECURSION_SUCCESS, notificationExt.SHOW_RIGHT_USER_GROUP_INFO]; 17 | // 关心的消息处理 18 | this.handleNotification = function (data) { 19 | switch (data.name) { 20 | case notificationExt.CHANGE_RIGHT_CONTENT: 21 | if (data.body.name === "userList") { 22 | moduleManager.loadModule("html/userList.html", document.getElementById("right_content"), "right_content", new UserListMediator(), data.body.data); 23 | this.nowState = "userList"; 24 | } else if (data.body.name === "createGroup") { 25 | moduleManager.loadModule("html/createGroup.html", document.getElementById("right_content"), "right_content", new CreateGroupMediator(), data.body.data); 26 | this.nowState = "createGroup"; 27 | } else if (data.body.name === "createGroup1") { 28 | moduleManager.loadModule("html/createGroup1.html", document.getElementById("right_content"), "right_content", new CreateGroup1Mediator(), data.body.data); 29 | this.nowState = "createGroup1"; 30 | } 31 | break; 32 | case notificationExt.GET_USER_GROUP_RECURSION_SUCCESS: 33 | this.getUserGroupRecursion(data.body); 34 | break; 35 | case notificationExt.SHOW_RIGHT_USER_GROUP_INFO: 36 | this.showRightUserGroupInfo(data.body); 37 | if (this.nowState !== "userList") { 38 | moduleManager.loadModule("html/userList.html", document.getElementById("right_content"), "right_content", new UserListMediator(), data.body); 39 | this.nowState = "userList"; 40 | } 41 | break; 42 | } 43 | }; 44 | this.showRightUserGroupInfo = function (userGroupId) { 45 | userGroupProxy.getUserGroupRecursion(userGroupId); 46 | }; 47 | this.getUserGroupRecursion = function (data) { 48 | $("#right_recursion").empty(); 49 | for (var i = data.recursionUserGroupList.length - 1; i >= 0; i--) { 50 | var userGroup = data.recursionUserGroupList[i]; 51 | var html = ""; 52 | if (i !== 0) { 53 | html += '' + userGroup.userGroupName + ''; 54 | } else { 55 | html += '' + userGroup.userGroupName + ''; 56 | } 57 | $("#right_recursion").append($(html)); 58 | } 59 | }; 60 | Mediator.apply(this); 61 | }; 62 | window.uca.RightMediator = RightMediator; 63 | })(window); -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/lib/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (value !== undefined && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | -------------------------------------------------------------------------------- /StartpointServer/src/main/java/org/startpoint/server/Expand.java: -------------------------------------------------------------------------------- 1 | package org.startpoint.server; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.InputStream; 6 | import java.net.URL; 7 | import java.util.Properties; 8 | import java.util.TimeZone; 9 | 10 | import javax.servlet.ServletContext; 11 | import javax.servlet.http.HttpServlet; 12 | 13 | import org.grain.httpserver.HttpConfig; 14 | import org.grain.httpserver.HttpManager; 15 | import org.grain.httpserver.IExpandServer; 16 | import org.grain.mariadb.MybatisManager; 17 | import org.grain.threadkeylock.KeyLockManager; 18 | import org.startpoint.config.CommonConfigUCenter; 19 | import org.startpoint.http.HOpCodeUCenter; 20 | import org.startpoint.http.filter.TokenHttpFilter; 21 | import org.startpoint.keylock.UCenterKeyLockType; 22 | import org.startpoint.log.KeylockLog; 23 | import org.startpoint.log.MariadbLog; 24 | import org.startpoint.service.TokenService; 25 | import org.startpoint.service.UserGroupService; 26 | import org.startpoint.service.UserService; 27 | 28 | public class Expand implements IExpandServer { 29 | 30 | @Override 31 | public void init(HttpServlet servlet) throws Exception { 32 | TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai")); 33 | ServletContext servletContext = servlet.getServletContext(); 34 | String configFileName = servletContext.getInitParameter("configFileName"); 35 | Properties properties = loadConfig(configFileName); 36 | MybatisManager.init(properties.getProperty("config_dir"), "mybatis-config.xml", new MariadbLog()); 37 | KeyLockManager.init(new UCenterKeyLockType().getkeyLockType(), 120000, 100, new KeylockLog()); 38 | HOpCodeUCenter.init(); 39 | CommonConfigUCenter.init(); 40 | CommonConfigUCenter.UCENTER_URL = properties.getProperty("uCenterUrl"); 41 | CommonConfigUCenter.CONFIG_DIR = properties.getProperty("config_dir"); 42 | HttpManager.addFilter(new TokenHttpFilter()); 43 | HttpManager.addHttpListener(new UserService()); 44 | HttpManager.addHttpListener(new UserGroupService()); 45 | HttpManager.addHttpListener(new TokenService()); 46 | } 47 | 48 | private Properties loadConfig(String configFileName) throws Exception { 49 | HttpConfig.log.info("初始化基础配置文件"); 50 | InputStream inputStream = null; 51 | URL url = this.getClass().getClassLoader().getResource(configFileName); 52 | if (url != null) { 53 | HttpConfig.log.info("Init.class.getClassLoader().getResource找到配置文件,路径为:" + url.getPath()); 54 | inputStream = this.getClass().getClassLoader().getResourceAsStream(configFileName); 55 | } else { 56 | HttpConfig.log.info("Init.class.getClassLoader().getResource:" + this.getClass().getClassLoader().getResource("").getPath() + ",未找到配置文件:" + configFileName); 57 | } 58 | if (inputStream == null) { 59 | File file = new File(System.getProperty("catalina.base") + "/" + configFileName); 60 | if (file.exists()) { 61 | HttpConfig.log.info("System.getProperty(\"catalina.base\")找到配置文件,路径为" + System.getProperty("catalina.base") + "/" + configFileName); 62 | inputStream = new FileInputStream(file); 63 | } else { 64 | HttpConfig.log.info("System.getProperty(\"catalina.base\"):" + System.getProperty("catalina.base") + ",未找到配置文件:" + configFileName); 65 | } 66 | } 67 | if (inputStream == null) { 68 | File file = new File(configFileName); 69 | if (file.exists()) { 70 | HttpConfig.log.info("找到配置文件,路径为" + file.getAbsolutePath()); 71 | inputStream = new FileInputStream(file); 72 | } else { 73 | HttpConfig.log.info("未找到配置文件:" + configFileName); 74 | } 75 | } 76 | if (inputStream != null) { 77 | Properties properties = new Properties(); 78 | properties.load(inputStream); 79 | HttpConfig.log.info("初始化基础配置文件完成"); 80 | inputStream.close(); 81 | return properties; 82 | } else { 83 | HttpConfig.log.warn("未找到配置文件:" + configFileName); 84 | throw new Exception("未找到配置文件" + configFileName); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /startpoint.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost_3307 5 | Source Server Version : 50505 6 | Source Host : localhost:3307 7 | Source Database : ucenter 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50505 11 | File Encoding : 65001 12 | 13 | Date: 2017-05-22 13:32:12 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for token 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `token`; 22 | CREATE TABLE `token` ( 23 | `token_id` varchar(64) NOT NULL, 24 | `user_id` varchar(64) NOT NULL, 25 | `token_create_time` datetime NOT NULL, 26 | `token_update_time` datetime NOT NULL, 27 | `token_expire_time` datetime NOT NULL, 28 | PRIMARY KEY (`token_id`), 29 | UNIQUE KEY `user_id` (`user_id`), 30 | CONSTRAINT `token_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) 31 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 32 | 33 | -- ---------------------------- 34 | -- Records of token 35 | -- ---------------------------- 36 | 37 | -- ---------------------------- 38 | -- Table structure for user 39 | -- ---------------------------- 40 | DROP TABLE IF EXISTS `user`; 41 | CREATE TABLE `user` ( 42 | `user_id` varchar(64) NOT NULL, 43 | `user_name` varchar(255) NOT NULL, 44 | `user_password` varchar(255) NOT NULL, 45 | `user_phone` varchar(11) DEFAULT NULL COMMENT '手机', 46 | `user_email` varchar(255) DEFAULT NULL, 47 | `user_create_time` datetime NOT NULL, 48 | `user_update_time` datetime NOT NULL, 49 | `user_state` tinyint(4) NOT NULL COMMENT '1:可用 2:不可用 3:逻辑上删除', 50 | `user_group_id` varchar(64) DEFAULT NULL, 51 | `user_real_name` varchar(255) DEFAULT NULL, 52 | `user_sex` tinyint(4) DEFAULT NULL COMMENT '1:女 2:男', 53 | `user_age` tinyint(4) DEFAULT NULL, 54 | `user_group_top_id` varchar(64) DEFAULT NULL, 55 | `user_role` tinyint(4) NOT NULL COMMENT '1:普通用户2:组织管理员3:用户中心管理员', 56 | `user_img` varchar(255) DEFAULT NULL, 57 | PRIMARY KEY (`user_id`), 58 | UNIQUE KEY `user_name` (`user_name`) USING BTREE, 59 | UNIQUE KEY `user_phone` (`user_phone`) USING BTREE, 60 | UNIQUE KEY `user_email` (`user_email`) USING BTREE, 61 | KEY `user_group_id` (`user_group_id`), 62 | KEY `user_group_top_id` (`user_group_top_id`), 63 | CONSTRAINT `user_ibfk_1` FOREIGN KEY (`user_group_id`) REFERENCES `user_group` (`user_group_id`), 64 | CONSTRAINT `user_ibfk_2` FOREIGN KEY (`user_group_top_id`) REFERENCES `user_group` (`user_group_id`) 65 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 66 | 67 | -- ---------------------------- 68 | -- Records of user 69 | -- ---------------------------- 70 | INSERT INTO `user` VALUES ('admin', 'admin', '123456', null, null, '2017-03-29 09:23:18', '2017-03-29 09:23:22', '1', null, null, null, null, null, '3', null); 71 | 72 | -- ---------------------------- 73 | -- Table structure for user_group 74 | -- ---------------------------- 75 | DROP TABLE IF EXISTS `user_group`; 76 | CREATE TABLE `user_group` ( 77 | `user_group_id` varchar(64) NOT NULL, 78 | `user_group_name` varchar(255) NOT NULL, 79 | `user_group_parent_id` varchar(64) DEFAULT NULL COMMENT '空 :代表顶级', 80 | `user_group_create_time` datetime NOT NULL, 81 | `user_group_update_time` datetime NOT NULL, 82 | `user_group_state` tinyint(4) NOT NULL COMMENT '1:可用 2:不可用 3:逻辑上删除', 83 | `user_group_top_id` varchar(64) DEFAULT NULL, 84 | PRIMARY KEY (`user_group_id`), 85 | UNIQUE KEY `user_group_name` (`user_group_name`,`user_group_top_id`) USING BTREE, 86 | KEY `user_group_parent_id` (`user_group_parent_id`), 87 | KEY `user_group_top_id` (`user_group_top_id`), 88 | CONSTRAINT `user_group_ibfk_1` FOREIGN KEY (`user_group_parent_id`) REFERENCES `user_group` (`user_group_id`), 89 | CONSTRAINT `user_group_ibfk_2` FOREIGN KEY (`user_group_top_id`) REFERENCES `user_group` (`user_group_id`) 90 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 91 | 92 | -- ---------------------------- 93 | -- Records of user_group 94 | -- ---------------------------- 95 | -------------------------------------------------------------------------------- /StartpointClient/css/index.css: -------------------------------------------------------------------------------- 1 | @import "reset.css"; 2 | @import "left.css"; 3 | .head{width:100%;height:50px;background:#398dee} 4 | .head_icon1{width:62px;height:50px;background:url("../images/icon01.png") no-repeat center center;margin-left:15px;display:inline-block;vertical-align:top} 5 | .title{font-size:22px;line-height:50px;color:#fff;display:inline-block;vertical-align:top;padding-left:10px} 6 | .head_control{float:right;padding-top:10px;margin-right:20px} 7 | .head_control dt{display:inline-block;vertical-align:top} 8 | .head_control dt img{width:30px;height:30px;border-radius:50%;display:inline-block;vertical-align:top} 9 | .head_per{display:inline-block;height:30px;line-height:30px;font-size:14px;color:#fff;vertical-align:top} 10 | .head_control dd{display:inline-block;vertical-align:top} 11 | .head_control dd i{display:inline-block;width:2px;height:14px;background:url("../images/line.png") no-repeat center center;position:relative;top:10px;margin:0 10px;vertical-align:top} 12 | .head_control dd a {display:inline-block;height:30px;line-height:30px;font-size:14px;color:#fff;vertical-align:top;padding-left:26px;padding-right:10px;background:url("../images/icon2.png") no-repeat 0 7px } 13 | .head_control dd a:hover {background-image:url("../images/icon2_hover.png")} 14 | .main{background-color:#fff} 15 | .left{width:270px;border-right:1px solid #e0e1e5;background-color:#f5f5f5;height:auto;position:absolute;z-index:1;left:0;top:50px} 16 | .right{position:relative;padding-left:271px;width:100%;box-sizing:border-box;} 17 | .crumb{height:40px;border-bottom:1px solid #e0e1e5;padding-top:20px} 18 | .crumb a{font-size:14px;color:#999;background:url(../images/crumb.png) right center no-repeat;padding-right:20px;display:inline;padding-left:20px;line-height:18px} 19 | .crumb .crumb_cur{color:#398dee;display:inline;margin-left:8px;line-height:18px} 20 | .content{padding:0 20px} 21 | .tit{font-size:14px;font-weight:700;color:#121315;height:56px;line-height:56px} 22 | .box li{display:block} 23 | .box p{line-height:40px;color:#5d5d61;margin-right:14px;float:left} 24 | .box .inp{float:left} 25 | .detail{padding:15px 0;background-color:#f5f5f5} 26 | .detail li{float:left;width:25%;padding-left:20px;border-right:1px solid #d3dadc;box-sizing:border-box} 27 | .p01{color:#999;font-size:12px;line-height:24px} 28 | .p02{font-size:16px;line-height:20px;color:#121315;margin-top:5px;} 29 | .nobr{border-right:0!important} 30 | /*表格*/ 31 | .myTable{border:1px solid #dedede;width:100%} 32 | .myTable thead{background-color:#f5f5f5;border-bottom:1px solid #dedede} 33 | .myTable thead th{height:36px;color:#5d5d61} 34 | .myTable tbody td{text-align:center;height:33px;color:#5d5d61;line-height:16px;padding:5px} 35 | .myTable td a{color:#1276e5;margin:0 10px} 36 | .myTable td img{width:30px;height:30px} 37 | .myTable tr{border-bottom:1px solid #dedede} 38 | .myTable tr:hover{background-color:#f4f7fd} 39 | /*修改页面*/ 40 | .pre100{display:block;width:100%} 41 | .layerBox .box li{float:left;margin-bottom:38px;position:relative} 42 | .layerBox .box li>p{width:92px;text-align:right;line-height:40px;float:left;margin-right:14px} 43 | .radio_box{height:40px} 44 | .radio_box label{line-height:40px} 45 | /*头像*/ 46 | .photo_box img{width:60px;height:60px} 47 | /*用户详情弹窗*/ 48 | .user_info_box{width:860px;height:290px;box-sizing: border-box;padding:35px 35px;} 49 | .user_info_box>img{width:120px;height:120px;} 50 | .user_table_box{width:550px;height:220px;margin-top:10px;margin-left:15px;} 51 | .user_table_box>table{width: 100%} 52 | .user_table_box>table tr th{padding:10px 0;vertical-align: top;width:100px;color:#999999;text-align: right} 53 | .user_table_box>table tr td{padding:10px 0;vertical-align: top;color:#333333;text-align: left;padding-left:20px;padding-right:10px;} 54 | .page{text-align:center;margin:30px auto 68px auto} 55 | .layerBox{background:#fff} 56 | .w294{width:294px!important} 57 | .w500{width:500px!important} 58 | .w378{width:378px} 59 | .w388{width:388px} 60 | .w294{width:294px} 61 | .mr25{margin-right:25px} 62 | .mt16{margin-top:16px} 63 | .mt18{margin-top:18px} 64 | .mt20{margin-top:20px} 65 | .mt29{margin-top:29px} 66 | .mb18{margin-bottom:18px} 67 | .mb8{margin-bottom:8px} 68 | .ml10{margin-left:10px} 69 | .pt16{padding-top:16px} 70 | .lineH60{line-height:60px!important} 71 | -------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-http.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.juggle) window.juggle = {}; 3 | var HttpEventType = function () { 4 | this.ERROR = "error"; 5 | this.SUCCESS = "success"; 6 | }; 7 | window.juggle.httpEventType = new HttpEventType(); 8 | })(window); 9 | (function (window) { 10 | if (!window.juggle) window.juggle = {}; 11 | var EventDispatcher = window.juggle.EventDispatcher; 12 | var httpEventType = window.juggle.httpEventType; 13 | var HttpClient = function () { 14 | EventDispatcher.apply(this); 15 | this.send = function (data, url, header, type, isAsync) { 16 | this.data = data; 17 | this.url = url; 18 | this.header = header; 19 | var xMLHttpRequest = new XMLHttpRequest(); 20 | if (xMLHttpRequest === null || xMLHttpRequest === undefined) { 21 | return false; 22 | } 23 | if (isAsync === null || isAsync === undefined) { 24 | isAsync = true; 25 | } 26 | if (type === null || type === undefined) { 27 | if (data === null || data === undefined) { 28 | type = "get"; 29 | } else { 30 | type = "post"; 31 | } 32 | } 33 | this.type = type; 34 | this.isAsync = isAsync; 35 | xMLHttpRequest.open(type, url, isAsync); 36 | for (var headName in header) { 37 | xMLHttpRequest.setRequestHeader(headName, header[headName]); 38 | } 39 | this.addHttpListener(this, xMLHttpRequest, this.sendReturn, data); 40 | if (type === "post") { 41 | xMLHttpRequest.setRequestHeader('Content-Type', 'application/json'); 42 | xMLHttpRequest.send(JSON.stringify(data)); 43 | } else { 44 | xMLHttpRequest.send(); 45 | } 46 | }; 47 | this.addHttpListener = function (httpClient, xMLHttpRequest, sendReturn, data) { 48 | var onReadyStateHandle = function (event) { 49 | sendReturn.call(httpClient, xMLHttpRequest, event, data); 50 | }; 51 | xMLHttpRequest.onreadystatechange = onReadyStateHandle; 52 | }; 53 | this.sendReturn = function (xMLHttpRequest, event, data) { 54 | if (xMLHttpRequest.readyState === 4) { 55 | if (xMLHttpRequest.status === 200) { 56 | //派发请求成功返回数据 57 | this.dispatchEventWith(httpEventType.SUCCESS, false, xMLHttpRequest.responseText); 58 | } else { 59 | //派发请求错误 60 | this.dispatchEventWith(httpEventType.ERROR); 61 | } 62 | } 63 | }; 64 | this.sendFile = function (fileList, data, url, header, type, isAsync) { 65 | this.data = data; 66 | this.url = url; 67 | this.header = header; 68 | var xMLHttpRequest = new XMLHttpRequest(); 69 | if (xMLHttpRequest === null || xMLHttpRequest === undefined) { 70 | return false; 71 | } 72 | if (isAsync === null || isAsync === undefined) { 73 | isAsync = true; 74 | } 75 | if (type === null || type === undefined) { 76 | type = "post"; 77 | } 78 | this.type = type; 79 | this.isAsync = isAsync; 80 | xMLHttpRequest.open(type, url, isAsync); 81 | for (var headName in header) { 82 | xMLHttpRequest.setRequestHeader(headName, header[headName]); 83 | } 84 | this.addHttpListener(this, xMLHttpRequest, this.sendReturn, data); 85 | var form = new FormData(); 86 | for (var i = 0; i < fileList.length; i++) { 87 | var file = fileList[i]; 88 | form.append("file" + i, file); 89 | } 90 | if (data !== null && data !== undefined) { 91 | for (var key in data) { 92 | form.append(key, data[key]); 93 | } 94 | } 95 | xMLHttpRequest.send(form); 96 | } 97 | }; 98 | window.juggle.HttpClient = HttpClient; 99 | })(window); 100 | -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/lib/juggle-http.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.juggle) window.juggle = {}; 3 | var HttpEventType = function () { 4 | this.ERROR = "error"; 5 | this.SUCCESS = "success"; 6 | }; 7 | window.juggle.httpEventType = new HttpEventType(); 8 | })(window); 9 | (function (window) { 10 | if (!window.juggle) window.juggle = {}; 11 | var EventDispatcher = window.juggle.EventDispatcher; 12 | var httpEventType = window.juggle.httpEventType; 13 | var HttpClient = function () { 14 | EventDispatcher.apply(this); 15 | this.send = function (data, url, header, type, isAsync) { 16 | this.data = data; 17 | this.url = url; 18 | this.header = header; 19 | var xMLHttpRequest = new XMLHttpRequest(); 20 | if (xMLHttpRequest === null || xMLHttpRequest === undefined) { 21 | return false; 22 | } 23 | if (isAsync === null || isAsync === undefined) { 24 | isAsync = true; 25 | } 26 | if (type === null || type === undefined) { 27 | if (data === null || data === undefined) { 28 | type = "get"; 29 | } else { 30 | type = "post"; 31 | } 32 | } 33 | this.type = type; 34 | this.isAsync = isAsync; 35 | xMLHttpRequest.open(type, url, isAsync); 36 | for (var headName in header) { 37 | xMLHttpRequest.setRequestHeader(headName, header[headName]); 38 | } 39 | this.addHttpListener(this, xMLHttpRequest, this.sendReturn, data); 40 | if (type === "post") { 41 | xMLHttpRequest.setRequestHeader('Content-Type', 'application/json'); 42 | xMLHttpRequest.send(JSON.stringify(data)); 43 | } else { 44 | xMLHttpRequest.send(); 45 | } 46 | }; 47 | this.addHttpListener = function (httpClient, xMLHttpRequest, sendReturn, data) { 48 | var onReadyStateHandle = function (event) { 49 | sendReturn.call(httpClient, xMLHttpRequest, event, data); 50 | }; 51 | xMLHttpRequest.onreadystatechange = onReadyStateHandle; 52 | }; 53 | this.sendReturn = function (xMLHttpRequest, event, data) { 54 | if (xMLHttpRequest.readyState === 4) { 55 | if (xMLHttpRequest.status === 200) { 56 | //派发请求成功返回数据 57 | this.dispatchEventWith(httpEventType.SUCCESS, false, xMLHttpRequest.responseText); 58 | } else { 59 | //派发请求错误 60 | this.dispatchEventWith(httpEventType.ERROR); 61 | } 62 | } 63 | }; 64 | this.sendFile = function (fileList, data, url, header, type, isAsync) { 65 | this.data = data; 66 | this.url = url; 67 | this.header = header; 68 | var xMLHttpRequest = new XMLHttpRequest(); 69 | if (xMLHttpRequest === null || xMLHttpRequest === undefined) { 70 | return false; 71 | } 72 | if (isAsync === null || isAsync === undefined) { 73 | isAsync = true; 74 | } 75 | if (type === null || type === undefined) { 76 | type = "post"; 77 | } 78 | this.type = type; 79 | this.isAsync = isAsync; 80 | xMLHttpRequest.open(type, url, isAsync); 81 | for (var headName in header) { 82 | xMLHttpRequest.setRequestHeader(headName, header[headName]); 83 | } 84 | this.addHttpListener(this, xMLHttpRequest, this.sendReturn, data); 85 | var form = new FormData(); 86 | for (var i = 0; i < fileList.length; i++) { 87 | var file = fileList[i]; 88 | form.append("file" + i, file); 89 | } 90 | if (data !== null && data !== undefined) { 91 | for (var key in data) { 92 | form.append(key, data[key]); 93 | } 94 | } 95 | xMLHttpRequest.send(form); 96 | } 97 | }; 98 | window.juggle.HttpClient = HttpClient; 99 | })(window); 100 | -------------------------------------------------------------------------------- /StartpointClient/js/lib/juggle-resource.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.juggle) window.juggle = {}; 3 | function ResourceEventType() { 4 | /** 5 | * 加载完成 6 | * @type {string} 7 | */ 8 | this.LOAD_COMPLETE = "loadComplete"; 9 | /** 10 | * 加载失败 11 | * @type {string} 12 | */ 13 | this.LOAD_FAIL = "loadFail"; 14 | } 15 | 16 | window.juggle.resourceEventType = new ResourceEventType(); 17 | })(window); 18 | (function (window) { 19 | if (!window.juggle) window.juggle = {}; 20 | var EventDispatcher = window.juggle.EventDispatcher; 21 | var HttpClient = window.juggle.HttpClient; 22 | var httpEventType = window.juggle.httpEventType; 23 | var resourceEventType = window.juggle.resourceEventType; 24 | var Loader = function (loadList, data) { 25 | /** 26 | * 加载成功 27 | * @param event 28 | */ 29 | this.loadSuccess = function (event) { 30 | this.resultArray[event.mTarget.url] = event.mData; 31 | this.successNum++; 32 | if (this.successNum + this.failNum === this.loadList.length) { 33 | if (this.failNum > 0) { 34 | this.dispatchEventWith(resourceEventType.LOAD_FAIL); 35 | } else { 36 | this.dispatchEventWith(resourceEventType.LOAD_COMPLETE); 37 | } 38 | } 39 | }; 40 | /** 41 | * 加载失败 42 | * @param event 43 | */ 44 | this.loadError = function (event) { 45 | this.failNum++; 46 | if (this.successNum + this.failNum === this.loadList.length) { 47 | this.dispatchEventWith(resourceEventType.LOAD_FAIL); 48 | } 49 | 50 | }; 51 | this.loadList = loadList; 52 | this.resultArray = []; 53 | this.successNum = 0; 54 | this.failNum = 0; 55 | this.data = data; 56 | EventDispatcher.apply(this); 57 | //获取资源 58 | for (var i = 0; i < this.loadList.length; i++) { 59 | var httpClient = new HttpClient(); 60 | httpClient.send(null, this.loadList[i]); 61 | httpClient.addEventListener(httpEventType.SUCCESS, this.loadSuccess, this); 62 | httpClient.addEventListener(httpEventType.ERROR, this.loadError, this); 63 | } 64 | }; 65 | window.juggle.Loader = Loader; 66 | })(window); 67 | (function (window) { 68 | if (!window.juggle) window.juggle = {}; 69 | var Loader = window.juggle.Loader; 70 | var resourceEventType = window.juggle.resourceEventType; 71 | var ResourceManager = function () { 72 | this.resource = []; 73 | this.loadResource = function (url, success, fail, obj) { 74 | var loader = new Loader(url, [success, fail, obj]); 75 | loader.addEventListener(resourceEventType.LOAD_COMPLETE, this.loadComplete, this); 76 | loader.addEventListener(resourceEventType.LOAD_FAIL, this.loadFail, this); 77 | }; 78 | /** 79 | * 成功回调 80 | * @param event 81 | */ 82 | this.loadComplete = function (event) { 83 | event.mTarget.removeEventListener(resourceEventType.LOAD_COMPLETE, this.loadComplete); 84 | event.mTarget.removeEventListener(resourceEventType.LOAD_FAIL, this.loadComplete); 85 | for (var i = 0; i < event.mTarget.loadList.length; i++) { 86 | var url = event.mTarget.loadList[i]; 87 | this.resource[url] = event.mTarget.resultArray[url]; 88 | } 89 | event.mTarget.data[0].call(event.mTarget.data[2], event.mTarget.loadList); 90 | }; 91 | /** 92 | * 失败回调 93 | * @param event 94 | */ 95 | this.loadFail = function (event) { 96 | event.mTarget.removeEventListener(resourceEventType.LOAD_COMPLETE, this.loadComplete); 97 | event.mTarget.removeEventListener(resourceEventType.LOAD_FAIL, this.loadComplete); 98 | event.mTarget.data[1].call(event.mTarget.data[1], event.mTarget.loadList); 99 | }; 100 | this.getResource = function (url) { 101 | return this.resource[url]; 102 | } 103 | }; 104 | window.juggle.resourceManager = new ResourceManager(); 105 | })(window); -------------------------------------------------------------------------------- /StartpointServer/WebContent/js/lib/juggle-resource.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | if (!window.juggle) window.juggle = {}; 3 | function ResourceEventType() { 4 | /** 5 | * 加载完成 6 | * @type {string} 7 | */ 8 | this.LOAD_COMPLETE = "loadComplete"; 9 | /** 10 | * 加载失败 11 | * @type {string} 12 | */ 13 | this.LOAD_FAIL = "loadFail"; 14 | } 15 | 16 | window.juggle.resourceEventType = new ResourceEventType(); 17 | })(window); 18 | (function (window) { 19 | if (!window.juggle) window.juggle = {}; 20 | var EventDispatcher = window.juggle.EventDispatcher; 21 | var HttpClient = window.juggle.HttpClient; 22 | var httpEventType = window.juggle.httpEventType; 23 | var resourceEventType = window.juggle.resourceEventType; 24 | var Loader = function (loadList, data) { 25 | /** 26 | * 加载成功 27 | * @param event 28 | */ 29 | this.loadSuccess = function (event) { 30 | this.resultArray[event.mTarget.url] = event.mData; 31 | this.successNum++; 32 | if (this.successNum + this.failNum === this.loadList.length) { 33 | if (this.failNum > 0) { 34 | this.dispatchEventWith(resourceEventType.LOAD_FAIL); 35 | } else { 36 | this.dispatchEventWith(resourceEventType.LOAD_COMPLETE); 37 | } 38 | } 39 | }; 40 | /** 41 | * 加载失败 42 | * @param event 43 | */ 44 | this.loadError = function (event) { 45 | this.failNum++; 46 | if (this.successNum + this.failNum === this.loadList.length) { 47 | this.dispatchEventWith(resourceEventType.LOAD_FAIL); 48 | } 49 | 50 | }; 51 | this.loadList = loadList; 52 | this.resultArray = []; 53 | this.successNum = 0; 54 | this.failNum = 0; 55 | this.data = data; 56 | EventDispatcher.apply(this); 57 | //获取资源 58 | for (var i = 0; i < this.loadList.length; i++) { 59 | var httpClient = new HttpClient(); 60 | httpClient.send(null, this.loadList[i]); 61 | httpClient.addEventListener(httpEventType.SUCCESS, this.loadSuccess, this); 62 | httpClient.addEventListener(httpEventType.ERROR, this.loadError, this); 63 | } 64 | }; 65 | window.juggle.Loader = Loader; 66 | })(window); 67 | (function (window) { 68 | if (!window.juggle) window.juggle = {}; 69 | var Loader = window.juggle.Loader; 70 | var resourceEventType = window.juggle.resourceEventType; 71 | var ResourceManager = function () { 72 | this.resource = []; 73 | this.loadResource = function (url, success, fail, obj) { 74 | var loader = new Loader(url, [success, fail, obj]); 75 | loader.addEventListener(resourceEventType.LOAD_COMPLETE, this.loadComplete, this); 76 | loader.addEventListener(resourceEventType.LOAD_FAIL, this.loadFail, this); 77 | }; 78 | /** 79 | * 成功回调 80 | * @param event 81 | */ 82 | this.loadComplete = function (event) { 83 | event.mTarget.removeEventListener(resourceEventType.LOAD_COMPLETE, this.loadComplete); 84 | event.mTarget.removeEventListener(resourceEventType.LOAD_FAIL, this.loadComplete); 85 | for (var i = 0; i < event.mTarget.loadList.length; i++) { 86 | var url = event.mTarget.loadList[i]; 87 | this.resource[url] = event.mTarget.resultArray[url]; 88 | } 89 | event.mTarget.data[0].call(event.mTarget.data[2], event.mTarget.loadList); 90 | }; 91 | /** 92 | * 失败回调 93 | * @param event 94 | */ 95 | this.loadFail = function (event) { 96 | event.mTarget.removeEventListener(resourceEventType.LOAD_COMPLETE, this.loadComplete); 97 | event.mTarget.removeEventListener(resourceEventType.LOAD_FAIL, this.loadComplete); 98 | event.mTarget.data[1].call(event.mTarget.data[1], event.mTarget.loadList); 99 | }; 100 | this.getResource = function (url) { 101 | return this.resource[url]; 102 | } 103 | }; 104 | window.juggle.resourceManager = new ResourceManager(); 105 | })(window); --------------------------------------------------------------------------------
' + (this.data.userRealName === undefined ? '无' : this.data.userRealName) + '' + (this.data.userPhone === undefined ? '无' : this.data.userPhone) + '' + (this.data.userRole === 1 ? '普通用户' : '企业管理员') + '' + 18 | '修改' + 19 | '删除' + 20 | '