├── fore-end └── cloud-vue │ ├── .gitignore │ ├── config │ ├── prod.env.js │ ├── dev.env.js │ └── index.js │ ├── src │ ├── .DS_Store │ ├── assets │ │ ├── .DS_Store │ │ ├── js │ │ │ ├── .DS_Store │ │ │ ├── form_com.js │ │ │ ├── list_com.js │ │ │ ├── global.js │ │ │ └── filter.js │ │ ├── images │ │ │ ├── bg1.jpg │ │ │ ├── .DS_Store │ │ │ ├── logo.png │ │ │ ├── logo1.png │ │ │ ├── logo2.png │ │ │ ├── logo3.png │ │ │ ├── logo4.png │ │ │ ├── logo5.png │ │ │ ├── logout_16.png │ │ │ ├── logout_24.png │ │ │ └── logout_36.png │ │ ├── plugins │ │ │ └── .DS_Store │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ └── css │ │ │ └── base.css │ ├── vuex │ │ ├── getters.js │ │ ├── state.js │ │ ├── store.js │ │ ├── mutations.js │ │ └── actions.js │ ├── components │ │ ├── .DS_Store │ │ ├── Common │ │ │ ├── .DS_Store │ │ │ ├── leftMenu.vue │ │ │ └── btn-group.vue │ │ ├── Administrative │ │ │ ├── .DS_Store │ │ │ ├── system │ │ │ │ ├── .DS_Store │ │ │ │ ├── rule │ │ │ │ │ ├── .DS_Store │ │ │ │ │ ├── add.vue │ │ │ │ │ ├── list.vue │ │ │ │ │ └── edit.vue │ │ │ │ ├── config │ │ │ │ │ └── preview.vue │ │ │ │ └── menu │ │ │ │ │ ├── rule.vue │ │ │ │ │ ├── list.vue │ │ │ │ │ └── add.vue │ │ │ ├── personnel │ │ │ │ ├── .DS_Store │ │ │ │ └── users │ │ │ │ │ └── .DS_Store │ │ │ └── structures │ │ │ │ ├── .DS_Store │ │ │ │ ├── groups │ │ │ │ ├── .DS_Store │ │ │ │ ├── list.vue │ │ │ │ └── add.vue │ │ │ │ ├── position │ │ │ │ ├── .DS_Store │ │ │ │ ├── add.vue │ │ │ │ ├── edit.vue │ │ │ │ └── list.vue │ │ │ │ └── structures │ │ │ │ ├── .DS_Store │ │ │ │ ├── add.vue │ │ │ │ ├── edit.vue │ │ │ │ └── list.vue │ │ ├── refresh.vue │ │ └── Account │ │ │ └── changePwd.vue │ ├── App.vue │ └── main.js │ ├── .babelrc │ ├── index.html │ ├── build │ ├── dev-client.js │ ├── build.js │ ├── webpack.dev.conf.js │ ├── check-versions.js │ ├── utils.js │ ├── dev-server.js │ ├── webpack.base.conf.js │ └── webpack.prod.conf.js │ ├── .eslintrc.json │ ├── README.md │ └── package.json ├── back-end └── cloud-vue-parent │ ├── cloud-config-server │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── docker │ │ │ └── Dockerfile │ │ │ ├── resources │ │ │ └── application.properties │ │ │ └── java │ │ │ └── cloud │ │ │ └── config │ │ │ └── server │ │ │ └── ConfigServerApplication.java │ └── pom.xml │ ├── cloud-zipkin-ui │ ├── .gitignore │ └── src │ │ └── main │ │ ├── resources │ │ ├── static │ │ │ ├── favicon.ico │ │ │ ├── user-page.html │ │ │ ├── js │ │ │ │ └── app.js │ │ │ └── index.html │ │ ├── log4j.properties │ │ ├── bootstrap.properties │ │ └── mysql_init.sql │ │ ├── docker │ │ └── Dockerfile │ │ └── java │ │ └── cloud │ │ └── zipkin │ │ └── ZipkinServerApplication.java │ ├── cloud-eureka-server │ ├── .gitignore │ └── src │ │ └── main │ │ ├── docker │ │ └── Dockerfile │ │ ├── java │ │ └── cloud │ │ │ └── eureka │ │ │ └── server │ │ │ └── EurekaServerApplication.java │ │ └── resources │ │ └── application.properties │ ├── .gitignore │ ├── cloud-simple-service │ ├── .gitignore │ └── src │ │ └── main │ │ ├── resources │ │ ├── META-INF │ │ │ ├── spring-devtools.properties │ │ │ └── spring.factories │ │ ├── static │ │ │ └── 1.png │ │ ├── mappers │ │ │ ├── SysAdminAccessDao.xml │ │ │ ├── SysAdminStructureDao.xml │ │ │ ├── SysAdminPostDao.xml │ │ │ ├── SysSystemConfigDao.xml │ │ │ ├── SysAdminRuleDao.xml │ │ │ ├── SysAdminGroupDao.xml │ │ │ ├── SysAdminUserDao.xml │ │ │ └── SysAdminMenuDao.xml │ │ ├── bootstrap.properties │ │ ├── application.properties │ │ └── logback-spring.xml │ │ ├── java │ │ └── cloud │ │ │ └── simple │ │ │ └── service │ │ │ ├── base │ │ │ ├── BaseDao.java │ │ │ ├── BaseEntity.java │ │ │ └── BaseService.java │ │ │ ├── dao │ │ │ ├── SysAdminPostDao.java │ │ │ ├── SysAdminUserDao.java │ │ │ ├── SysAdminAccessDao.java │ │ │ ├── SysSystemConfigDao.java │ │ │ ├── SysAdminStructureDao.java │ │ │ ├── SysAdminRuleDao.java │ │ │ ├── SysAdminGroupDao.java │ │ │ └── SysAdminMenuDao.java │ │ │ ├── util │ │ │ ├── MyMapper.java │ │ │ ├── UploadUtils.java │ │ │ ├── TreeBuilder.java │ │ │ ├── TreeUtil.java │ │ │ ├── Category.java │ │ │ └── BeanToMapUtil.java │ │ │ ├── contants │ │ │ └── Constant.java │ │ │ ├── domain │ │ │ ├── SysSystemConfigService.java │ │ │ ├── SysAdminAccessService.java │ │ │ ├── SysAdminPostService.java │ │ │ ├── SysAdminGroupService.java │ │ │ ├── SysAdminStructureService.java │ │ │ └── SysAdminUserService.java │ │ │ ├── CloundServiceApplication.java │ │ │ ├── model │ │ │ ├── SysAdminAccess.java │ │ │ ├── SysAdminStructure.java │ │ │ ├── SysAdminGroup.java │ │ │ ├── SysSystemConfig.java │ │ │ ├── SysAdminPost.java │ │ │ ├── SysAdminRule.java │ │ │ └── SysAdminUser.java │ │ │ ├── conf │ │ │ ├── CaptchaConfig.java │ │ │ ├── Swagger2Config.java │ │ │ ├── DruidAutoConfiguration.java │ │ │ ├── DruidProperties.java │ │ │ └── WebMvcConfig.java │ │ │ ├── web │ │ │ ├── CommonController.java │ │ │ ├── SysConfigController.java │ │ │ └── UploadController.java │ │ │ ├── dto │ │ │ └── TreeNode.java │ │ │ └── interceptor │ │ │ └── LoginInterceptor.java │ │ └── docker │ │ └── Dockerfile │ ├── cloud-config-repo │ ├── cloud-config-dev.properties │ └── cloud-config-test.properties │ └── pom.xml ├── pic ├── 二维码.jpg ├── 岗位管理.png ├── 注册中心.png ├── 登录.png ├── 菜单管理.png ├── 部门管理.png ├── zipkin.png ├── 权限规则管理.png ├── 用户组管理.png └── swagger.png └── readme.md /fore-end/cloud-vue/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-config-server/.gitignore: -------------------------------------------------------------------------------- 1 | target -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-zipkin-ui/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-eureka-server/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /pic/二维码.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/pic/二维码.jpg -------------------------------------------------------------------------------- /pic/岗位管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/pic/岗位管理.png -------------------------------------------------------------------------------- /pic/注册中心.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/pic/注册中心.png -------------------------------------------------------------------------------- /pic/登录.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/pic/登录.png -------------------------------------------------------------------------------- /pic/菜单管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/pic/菜单管理.png -------------------------------------------------------------------------------- /pic/部门管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/pic/部门管理.png -------------------------------------------------------------------------------- /pic/zipkin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/pic/zipkin.png -------------------------------------------------------------------------------- /pic/权限规则管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/pic/权限规则管理.png -------------------------------------------------------------------------------- /pic/用户组管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/pic/用户组管理.png -------------------------------------------------------------------------------- /fore-end/cloud-vue/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /pic/swagger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/pic/swagger.png -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | .classpath 3 | .project 4 | *.class 5 | target 6 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-3"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/vuex/getters.js: -------------------------------------------------------------------------------- 1 | const getters = { 2 | // getCount: state => state.count, 3 | } 4 | 5 | export default getters 6 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/js/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/js/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/bg1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/bg1.jpg -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/.DS_Store -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Package Files # 4 | *.jar 5 | *.war 6 | *.ear 7 | target 8 | /.apt_generated/ 9 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/logo.png -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/logo1.png -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/logo2.png -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/logo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/logo3.png -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/logo4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/logo4.png -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/logo5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/logo5.png -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/plugins/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/plugins/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/logout_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/logout_16.png -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/logout_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/logout_24.png -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/images/logout_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/images/logout_36.png -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Common/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/Common/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/Administrative/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/js/form_com.js: -------------------------------------------------------------------------------- 1 | const formMixin = { 2 | methods: { 3 | goback() { 4 | router.go(-1) 5 | } 6 | } 7 | } 8 | 9 | export default formMixin 10 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/system/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/Administrative/system/.DS_Store -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/META-INF/spring-devtools.properties: -------------------------------------------------------------------------------- 1 | restart.include.mapper=/mapper-[\\w-\\.]+jar 2 | restart.include.pagehelper=/pagehelper-[\\w-\\.]+jar -------------------------------------------------------------------------------- /fore-end/cloud-vue/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/personnel/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/Administrative/personnel/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/Administrative/structures/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/system/rule/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/Administrative/system/rule/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/personnel/users/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/Administrative/personnel/users/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/groups/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/Administrative/structures/groups/.DS_Store -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/static/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/static/1.png -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-zipkin-ui/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/back-end/cloud-vue-parent/cloud-zipkin-ui/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-zipkin-ui/src/main/resources/static/user-page.html: -------------------------------------------------------------------------------- 1 |
2 | 7 |
-------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/position/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/Administrative/structures/position/.DS_Store -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/structures/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OptionalDay/spring-cloud-vue/HEAD/fore-end/cloud-vue/src/components/Administrative/structures/structures/.DS_Store -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # Auto Configure 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | cloud.simple.service.conf.DruidAutoConfiguration -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/base/BaseDao.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.base; 2 | 3 | 4 | import tk.mybatis.mapper.common.Mapper; 5 | 6 | @SuppressWarnings("rawtypes") 7 | public interface BaseDao extends Mapper{ 8 | } 9 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/vuex/state.js: -------------------------------------------------------------------------------- 1 | const state = { 2 | showLeftMenu: true, 3 | globalLoading: true, 4 | menus: [], 5 | rules: [], 6 | users: {}, 7 | userGroups: [], 8 | organizes: [], 9 | authKey: "", 10 | sessionId: "" 11 | } 12 | 13 | export default state 14 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | vue element admin 6 | 7 | 8 |
9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/dao/SysAdminPostDao.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.dao; 2 | 3 | import cloud.simple.service.model.SysAdminPost; 4 | import cloud.simple.service.util.MyMapper; 5 | 6 | public interface SysAdminPostDao extends MyMapper { 7 | } -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/dao/SysAdminUserDao.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.dao; 2 | 3 | import cloud.simple.service.model.SysAdminUser; 4 | import cloud.simple.service.util.MyMapper; 5 | 6 | public interface SysAdminUserDao extends MyMapper { 7 | } -------------------------------------------------------------------------------- /fore-end/cloud-vue/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/dao/SysAdminAccessDao.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.dao; 2 | 3 | import cloud.simple.service.model.SysAdminAccess; 4 | import cloud.simple.service.util.MyMapper; 5 | 6 | public interface SysAdminAccessDao extends MyMapper { 7 | } -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/dao/SysSystemConfigDao.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.dao; 2 | 3 | import cloud.simple.service.model.SysSystemConfig; 4 | import cloud.simple.service.util.MyMapper; 5 | 6 | public interface SysSystemConfigDao extends MyMapper { 7 | } -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/refresh.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/dao/SysAdminStructureDao.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.dao; 2 | 3 | import cloud.simple.service.model.SysAdminStructure; 4 | import cloud.simple.service.util.MyMapper; 5 | 6 | public interface SysAdminStructureDao extends MyMapper { 7 | } -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/vuex/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | Vue.use(Vuex) 4 | import state from './state' 5 | import mutations from './mutations' 6 | import getters from './getters' 7 | import actions from './actions' 8 | export default new Vuex.Store({ 9 | state, 10 | mutations, 11 | getters, 12 | actions 13 | }) 14 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/util/MyMapper.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.util; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import tk.mybatis.mapper.common.MySqlMapper; 5 | 6 | 7 | /** 8 | * 继承自己的MyMapper 9 | *特别注意,该接口不能被扫描到,否则会出错 10 | */ 11 | public interface MyMapper extends Mapper, MySqlMapper { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-zipkin-ui/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | VOLUME /tmp 4 | 5 | ADD @project.build.finalName@.jar @project.build.finalName@.jar 6 | 7 | RUN sh -c 'touch /@project.build.finalName@.jar' 8 | 9 | ENV JAVA_OPTS="" 10 | 11 | CMD exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=docker -jar /@project.build.finalName@.jar -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-config-server/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | VOLUME /tmp 4 | 5 | ADD @project.build.finalName@.jar @project.build.finalName@.jar 6 | 7 | RUN sh -c 'touch /@project.build.finalName@.jar' 8 | 9 | ENV JAVA_OPTS="" 10 | 11 | CMD exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=docker -jar /@project.build.finalName@.jar -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-eureka-server/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | VOLUME /tmp 4 | 5 | ADD @project.build.finalName@.jar @project.build.finalName@.jar 6 | 7 | RUN sh -c 'touch /@project.build.finalName@.jar' 8 | 9 | ENV JAVA_OPTS="" 10 | 11 | CMD exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=docker -jar /@project.build.finalName@.jar -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | VOLUME /tmp 4 | 5 | ADD @project.build.finalName@.jar @project.build.finalName@.jar 6 | 7 | RUN sh -c 'touch /@project.build.finalName@.jar' 8 | 9 | ENV JAVA_OPTS="" 10 | 11 | CMD exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=docker -jar /@project.build.finalName@.jar -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-zipkin-ui/src/main/resources/static/js/app.js: -------------------------------------------------------------------------------- 1 | angular.module('users', ['ngRoute']).config(function ($routeProvider) { 2 | $routeProvider.when('/', { 3 | templateUrl: 'user-page.html', 4 | controller: 'userCtr' 5 | }) 6 | }).controller('userCtr', function ($scope, $http) { 7 | $http.get('users').success(function (data) { 8 | //alert(data+""); 9 | $scope.userList = data; 10 | }); 11 | }); -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-config-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=1111 2 | #spring.cloud.config.server.git.uri=https://git.oschina.net/zhou666/spring-cloud-7simple.git 3 | #spring.cloud.config.server.git.searchPaths=cloud-config-repo 4 | spring.application.name=cloud-config-server 5 | spring.cloud.config.server.native.searchLocations=../cloud-config-repo 6 | spring.profiles.active=native 7 | eureka.instance.hostname=localhost 8 | eureka.client.serviceUrl.defaultZone=http\://${eureka.instance.hostname}\:8888/eureka/ 9 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/system/config/preview.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-config-repo/cloud-config-dev.properties: -------------------------------------------------------------------------------- 1 | # =================================================================== 2 | # framework specific properties 3 | # =================================================================== 4 | 5 | # datasource 6 | druid.url=jdbc:mysql://localhost:3306/cloud-vue?useUnicode=true&characterEncoding=utf8&useSSL=false 7 | druid.driver-class=com.mysql.jdbc.Driver 8 | druid.username=root 9 | druid.password=root 10 | druid.initial-size=1 11 | druid.min-idle=1 12 | druid.max-active=20 13 | druid.test-on-borrow=true 14 | 15 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-config-repo/cloud-config-test.properties: -------------------------------------------------------------------------------- 1 | # =================================================================== 2 | # framework specific properties 3 | # =================================================================== 4 | 5 | # datasource 6 | druid.url=jdbc:mysql://localhost:3306/cloud-vue?useUnicode=true&characterEncoding=utf8&useSSL=false 7 | druid.driver-class=com.mysql.jdbc.Driver 8 | druid.username=root 9 | druid.password=root 10 | druid.initial-size=1 11 | druid.min-idle=1 12 | druid.max-active=20 13 | druid.test-on-borrow=true 14 | 15 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/dao/SysAdminRuleDao.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import cloud.simple.service.model.SysAdminRule; 8 | import cloud.simple.service.util.MyMapper; 9 | 10 | public interface SysAdminRuleDao extends MyMapper { 11 | 12 | List selectInIds(@Param("ruleIds") String ruleIds,@Param("status") Integer status); 13 | 14 | List selectByStatus(@Param("status") Integer status); 15 | } -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-eureka-server/src/main/java/cloud/eureka/server/EurekaServerApplication.java: -------------------------------------------------------------------------------- 1 | package cloud.eureka.server; 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication; 4 | import org.springframework.boot.builder.SpringApplicationBuilder; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaServerApplication { 10 | public static void main(String[] args) { 11 | new SpringApplicationBuilder(EurekaServerApplication.class).web(true).run(args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/contants/Constant.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.contants; 2 | /** 3 | * 常量类 4 | * 5 | */ 6 | public class Constant { 7 | //授权key 8 | public final static String AUTH_KEY = "authKey"; 9 | //sessoinid 10 | public final static String SESSION_ID = "sessionId"; 11 | //登录用户对象 12 | public final static String LOGIN_ADMIN_USER = "login_admin_user"; 13 | //安全密匙 14 | public static String SECRET_KEY = "#rSgRKVunlLUMopFWbEevOy9"; 15 | //菜单分类ICON 16 | public final static String[] ICON = new String[] {" │"," ├─"," └─"}; 17 | } 18 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/dao/SysAdminGroupDao.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import cloud.simple.service.model.SysAdminGroup; 8 | import cloud.simple.service.util.MyMapper; 9 | 10 | public interface SysAdminGroupDao extends MyMapper { 11 | /** 12 | * 查询分组信息 13 | * @param userId 用户ID 14 | * @param status 状态 15 | * @return 16 | */ 17 | List selectByUserId(@Param("userId") Integer userId,@Param("status") Byte status); 18 | } -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/mappers/SysAdminAccessDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/vuex/mutations.js: -------------------------------------------------------------------------------- 1 | const mutations = { 2 | showLeftMenu(state, status) { 3 | state.showLeftMenu = status 4 | }, 5 | showLoading(state, status) { 6 | state.globalLoading = status 7 | }, 8 | setMenus(state, menus) { 9 | state.menus = menus 10 | }, 11 | setRules(state, rules) { 12 | state.rules = rules 13 | }, 14 | setUsers(state, users) { 15 | state.users = users 16 | }, 17 | setUserGroups(state, userGroups) { 18 | state.userGroups = userGroups 19 | }, 20 | setOrganizes(state, organizes) { 21 | state.organizes = organizes 22 | } 23 | } 24 | 25 | export default mutations 26 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/dao/SysAdminMenuDao.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import cloud.simple.service.model.SysAdminMenu; 8 | import cloud.simple.service.util.MyMapper; 9 | 10 | public interface SysAdminMenuDao extends MyMapper { 11 | /** 12 | * 根据ruleIds查询菜单信息 13 | * @param ruleIds 权限id 14 | * @param status 状态值 15 | * @return List 16 | */ 17 | List selectInRuleIds(@Param("ruleIds") String ruleIds, @Param("status") int status); 18 | } -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/vuex/actions.js: -------------------------------------------------------------------------------- 1 | const actions = { 2 | showLeftMenu ({ commit }, status) { 3 | commit('showLeftMenu', status) 4 | }, 5 | showLoading ({ commit }, status) { 6 | commit('showLoading', status) 7 | }, 8 | setMenus({ commit }, menus) { 9 | commit('setMenus', menus) 10 | }, 11 | setRules({ commit }, rules) { 12 | commit('setRules', rules) 13 | }, 14 | setUsers({ commit }, users) { 15 | commit('setUsers', users) 16 | }, 17 | setUserGroups({ commit }, userGroups) { 18 | commit('setUserGroups', userGroups) 19 | }, 20 | setOrganizes({ commit }, organizes) { 21 | commit('setOrganizes', organizes) 22 | } 23 | } 24 | 25 | export default actions 26 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-zipkin-ui/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/mappers/SysAdminStructureDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/bootstrap.properties: -------------------------------------------------------------------------------- 1 | server.port=80 2 | 3 | spring.cloud.config.profile=dev 4 | spring.cloud.config.uri=http://${cofig.host:localhost}:${config.port:1111} 5 | spring.cloud.config.name=cloud-config 6 | #${config.profile:dev} 7 | #service discovery url 8 | eureka.client.serviceUrl.defaultZone=http\://${eureka.host:localhost}\:${eureka.port:8888}/eureka/ 9 | #service name 10 | spring.application.name=cloud-simple-service 11 | 12 | #spring profiles 13 | spring.profiles.active=dev 14 | spring.profiles.include=swagger 15 | #spring devtools 16 | spring.devtools.restart.enabled=false 17 | spring.devtools.livereload.enabled=false 18 | 19 | #zipkin 20 | spring.zipkin.base-url=http://localhost:9012 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-zipkin-ui/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, CONSOLE 2 | 3 | PID=???? 4 | LOG_PATTERN=[%d{yyyy-MM-dd HH:mm:ss.SSS}] log4j%X{context} - ${PID} %5p [%t] --- %c{1}: %m%n 5 | 6 | # CONSOLE is set to be a ConsoleAppender using a PatternLayout. 7 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 8 | log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout 9 | log4j.appender.CONSOLE.layout.ConversionPattern=${LOG_PATTERN} 10 | 11 | log4j.category.org.hibernate.validator.internal.util.Version=INFO 12 | log4j.category.org.apache.coyote.http11.Http11NioProtocol=INFO 13 | log4j.category.org.apache.tomcat.util.net.NioSelectorPool=INFO 14 | log4j.category.org.apache.catalina.startup.DigesterFactory=INFO 15 | log4j.logger.org.apache=INFO -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/domain/SysSystemConfigService.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.domain; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import cloud.simple.service.base.BaseServiceImpl; 7 | import cloud.simple.service.dao.SysSystemConfigDao; 8 | import cloud.simple.service.model.SysSystemConfig; 9 | import tk.mybatis.mapper.common.Mapper; 10 | @Service 11 | public class SysSystemConfigService extends BaseServiceImpl{ 12 | @Autowired 13 | private SysSystemConfigDao sysSystemConfigDao; 14 | 15 | @Override 16 | public Mapper getMapper() { 17 | return sysSystemConfigDao; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/domain/SysAdminAccessService.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.domain; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import cloud.simple.service.base.BaseServiceImpl; 7 | import cloud.simple.service.dao.SysAdminAccessDao; 8 | import cloud.simple.service.model.SysAdminAccess; 9 | import tk.mybatis.mapper.common.Mapper; 10 | 11 | @Service 12 | public class SysAdminAccessService extends BaseServiceImpl{ 13 | 14 | @Autowired 15 | private SysAdminAccessDao sysAdminAccessDao; 16 | 17 | @Override 18 | public Mapper getMapper() { 19 | return sysAdminAccessDao; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-eureka-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8888 2 | eureka.instance.hostname=localhost 3 | eureka.client.registerWithEureka=false 4 | eureka.client.fetchRegistry=false 5 | eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/ 6 | spring.application.name=cloud-eureka-server 7 | #renew\u9891\u7387\uff0c\u5411Eureka\u670d\u52a1\u53d1\u9001renew\u4fe1\u606f\uff0c\u9ed8\u8ba430\u79d2 8 | eureka.instance.leaseRenewalIntervalInSeconds=10 9 | #\u670d\u52a1\u5931\u6548\u65f6\u95f4\uff0cEureka\u591a\u957f\u65f6\u95f4\u6ca1\u6536\u5230\u670d\u52a1\u7684renew\u64cd\u4f5c\uff0c\u5c31\u5254\u9664\u8be5\u670d\u52a1\uff0c\u9ed8\u8ba490\u79d2 10 | eureka.instance.leaseExpirationDurationInSeconds=15 11 | #manager url:http://localhost:8761/ 12 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/mappers/SysAdminPostDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/mappers/SysSystemConfigDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": "vue", 4 | "env": { 5 | "browser": true, 6 | "es6": true 7 | }, 8 | "parserOptions": { 9 | "sourceType": "module" 10 | }, 11 | "rules": { 12 | "linebreak-style": ["error", "unix"], // 换行风格 13 | "quotes": [1, "single"], // 引号类型:使用单引号 14 | "semi": ["error", "never"], // 禁止分号作为语句结尾 15 | "eqeqeq": 0, // 关闭强制使用 '===' 和 '!==' 来做判断比较 16 | "no-unused-vars": 0, // 关闭强制 声明未使用变量 17 | "space-before-function-paren": 0, // 关闭函数名后的空格 18 | "prefer-const": 0, // 关闭首选const 19 | "no-undef": 0, // 关闭不能使用未定义变量 20 | "camelcase": 0 21 | } 22 | } -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-config-server/src/main/java/cloud/config/server/ConfigServerApplication.java: -------------------------------------------------------------------------------- 1 | package cloud.config.server; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.config.server.EnableConfigServer; 7 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 8 | import org.springframework.context.annotation.Configuration; 9 | 10 | @Configuration 11 | @EnableAutoConfiguration 12 | @EnableEurekaClient 13 | //@EnableDiscoveryClient 14 | @EnableConfigServer 15 | public class ConfigServerApplication { 16 | 17 | public static void main(String[] args) { 18 | SpringApplication.run(ConfigServerApplication.class, args); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/js/list_com.js: -------------------------------------------------------------------------------- 1 | const listMixin = { 2 | data() { 3 | return { 4 | currentPage: null, // 分页当前页 5 | keywords: '', // 关键字搜索 6 | multipleSelection: [], // 列表当前已勾选项 7 | limit: 15, // 每页数据数目 8 | dataCount: 0 9 | } 10 | }, 11 | methods: { 12 | selectItem(val) { 13 | this.multipleSelection = val 14 | }, 15 | getCurrentPage() { 16 | let data = this.$route.query 17 | if (data) { 18 | if (data.page) { 19 | this.currentPage = parseInt(data.page) 20 | } else { 21 | this.currentPage = 1 22 | } 23 | } 24 | }, 25 | getKeywords() { 26 | let data = this.$route.query 27 | if (data) { 28 | if (data.keywords) { 29 | this.keywords = data.keywords 30 | } else { 31 | this.keywords = '' 32 | } 33 | } 34 | } 35 | } 36 | } 37 | 38 | export default listMixin 39 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/build/build.js: -------------------------------------------------------------------------------- 1 | // https://github.com/shelljs/shelljs 2 | require('./check-versions')() 3 | require('shelljs/global') 4 | env.NODE_ENV = 'production' 5 | 6 | var path = require('path') 7 | var config = require('../config') 8 | var ora = require('ora') 9 | var webpack = require('webpack') 10 | var webpackConfig = require('./webpack.prod.conf') 11 | 12 | console.log( 13 | ' Tip:\n' + 14 | ' Built files are meant to be served over an HTTP server.\n' + 15 | ' Opening index.html over file:// won\'t work.\n' 16 | ) 17 | 18 | var spinner = ora('building for production...') 19 | spinner.start() 20 | 21 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 22 | rm('-rf', assetsPath) 23 | mkdir('-p', assetsPath) 24 | cp('-R', 'static/*', assetsPath) 25 | 26 | webpack(webpackConfig, function (err, stats) { 27 | spinner.stop() 28 | if (err) throw err 29 | process.stdout.write(stats.toString({ 30 | colors: true, 31 | modules: false, 32 | children: false, 33 | chunks: false, 34 | chunkModules: false 35 | }) + '\n') 36 | }) 37 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-zipkin-ui/src/main/resources/bootstrap.properties: -------------------------------------------------------------------------------- 1 | server.port=9012 2 | #spring cloud config 3 | spring.cloud.config.uri=http://127.0.0.1:${config.port:1111} 4 | spring.cloud.config.name=cloud-config 5 | spring.cloud.config.profile=${config.profile:dev} 6 | eureka.client.serviceUrl.defaultZone=http\://localhost\:8888/eureka/ 7 | #service name config 8 | spring.application.name=cloud-zipkin-ui 9 | #ribbon config 10 | cloud-simple-service.ribbon.ConnectTimeout=5000 11 | cloud-simple-service.ribbon.ReadTimeout=10000 12 | 13 | #spring profiles 14 | spring.profiles.active=dev 15 | 16 | spring.datasource.schema=classpath:/mysql_init.sql.sql 17 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 18 | spring.datasource.type: com.alibaba.druid.pool.DruidDataSource 19 | spring.datasource.url: jdbc:mysql://localhost:3306/zipkin 20 | spring.datasource.username=root 21 | spring.datasource.password=root 22 | spring.datasource.initialize=true 23 | spring.datasource.continueOnError=true 24 | 25 | #spring.sleuth.enabled: false 26 | 27 | # zipkin config 28 | zipkin.storage.type=mysql 29 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | logging.level.tk.mybatis=TRACE 2 | logging.level.com.framework=TRACE 3 | 4 | pagehelper.helperDialect=mysql 5 | pagehelper.reasonable=true 6 | pagehelper.supportMethodsArguments=true 7 | pagehelper.reasonable=true 8 | pagehelper.params=count=countSql 9 | 10 | mybatis.type-aliases-package=cloud.simple.service.model 11 | mybatis.mapper-locations=classpath*:/mappers/**.xml 12 | mapper.mappers=cloud.simple.service.util.MyMapper 13 | mapper.not-empty=true 14 | mapper.identity=MYSQL 15 | mybatis.configuration.mapUnderscoreToCamelCase=true 16 | 17 | #\u9ed8\u8ba4\u652f\u6301\u6587\u4ef6\u4e0a\u4f20. 18 | spring.http.multipart.enabled=true 19 | #\u652f\u6301\u6587\u4ef6\u5199\u5165\u78c1\u76d8. 20 | spring.http.multipart.file-size-threshold=0 21 | # \u4e0a\u4f20\u6587\u4ef6\u7684\u4e34\u65f6\u76ee\u5f55 22 | spring.http.multipart.location=D:/test 23 | # \u6700\u5927\u652f\u6301\u6587\u4ef6\u5927\u5c0f 24 | spring.http.multipart.max-file-size=1Mb 25 | # \u6700\u5927\u652f\u6301\u8bf7\u6c42\u5927\u5c0f 26 | spring.http.multipart.max-request-size=10Mb -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/CloundServiceApplication.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 7 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 11 | 12 | @Controller 13 | @Configuration 14 | @EnableDiscoveryClient 15 | @SpringBootApplication 16 | @EnableEurekaClient 17 | //@EnableWebMvc 18 | @MapperScan(basePackages={"cloud.simple.service.dao","com.framework.common.base"}) 19 | public class CloundServiceApplication extends WebMvcConfigurerAdapter { 20 | 21 | public static void main(String[] args) { 22 | SpringApplication.run(CloundServiceApplication.class, args); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/model/SysAdminAccess.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.model; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Table; 5 | 6 | import cloud.simple.service.base.BaseEntity; 7 | 8 | @Table(name = "`sys_admin_access`") 9 | public class SysAdminAccess extends BaseEntity { 10 | private static final long serialVersionUID = 7046525700737221455L; 11 | 12 | @Column(name = "`user_id`") 13 | private Integer userId; 14 | 15 | @Column(name = "`group_id`") 16 | private Integer groupId; 17 | 18 | /** 19 | * @return user_id 20 | */ 21 | public Integer getUserId() { 22 | return userId; 23 | } 24 | 25 | /** 26 | * @param userId 27 | */ 28 | public void setUserId(Integer userId) { 29 | this.userId = userId; 30 | } 31 | 32 | /** 33 | * @return group_id 34 | */ 35 | public Integer getGroupId() { 36 | return groupId; 37 | } 38 | 39 | /** 40 | * @param groupId 41 | */ 42 | public void setGroupId(Integer groupId) { 43 | this.groupId = groupId; 44 | } 45 | } -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/mappers/SysAdminRuleDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/mappers/SysAdminGroupDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/domain/SysAdminPostService.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.domain; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.commons.lang3.StringUtils; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import cloud.simple.service.base.BaseServiceImpl; 10 | import cloud.simple.service.model.SysAdminPost; 11 | import tk.mybatis.mapper.common.Mapper; 12 | import tk.mybatis.mapper.entity.Example; 13 | import tk.mybatis.mapper.entity.Example.Criteria; 14 | @Service 15 | public class SysAdminPostService extends BaseServiceImpl{ 16 | 17 | @Autowired 18 | private Mapper sysAdminPostDao; 19 | 20 | @Override 21 | public Mapper getMapper() { 22 | return sysAdminPostDao; 23 | } 24 | 25 | public List getDataList(String name) { 26 | Example example = new Example(SysAdminPost.class,false); 27 | Criteria criteria = example.createCriteria(); 28 | if(StringUtils.isNotBlank(name)){ 29 | criteria.andLike("name", name); 30 | } 31 | return sysAdminPostDao.selectByExample(example); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var config = require('../config') 2 | var webpack = require('webpack') 3 | var merge = require('webpack-merge') 4 | var utils = require('./utils') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | 8 | // add hot-reload related code to entry chunks 9 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 10 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 11 | }) 12 | 13 | module.exports = merge(baseWebpackConfig, { 14 | module: { 15 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 16 | }, 17 | // eval-source-map is faster for development 18 | devtool: '#eval-source-map', 19 | plugins: [ 20 | new webpack.DefinePlugin({ 21 | 'process.env': config.dev.env 22 | }), 23 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 24 | new webpack.optimize.OccurenceOrderPlugin(), 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'index.html', 31 | inject: true 32 | }) 33 | ] 34 | }) 35 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-zipkin-ui/src/main/java/cloud/zipkin/ZipkinServerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * @author lzhoumail@126.com/zhouli 5 | * Git http://git.oschina.net/zhou666/spring-cloud-7simple 6 | */ 7 | 8 | package cloud.zipkin; 9 | 10 | import org.springframework.boot.autoconfigure.SpringBootApplication; 11 | import org.springframework.boot.builder.SpringApplicationBuilder; 12 | import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; 13 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 14 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 15 | import org.springframework.context.annotation.Bean; 16 | import org.springframework.web.client.RestTemplate; 17 | 18 | import zipkin.server.EnableZipkinServer; 19 | 20 | 21 | @SpringBootApplication 22 | @EnableEurekaClient 23 | @EnableCircuitBreaker 24 | @EnableZipkinServer 25 | public class ZipkinServerApplication { 26 | 27 | public static void main(String[] args) throws Exception { 28 | new SpringApplicationBuilder(ZipkinServerApplication.class).web(true).run(args); 29 | } 30 | 31 | @LoadBalanced 32 | @Bean 33 | RestTemplate restTemplate() { 34 | return new RestTemplate(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/build/check-versions.js: -------------------------------------------------------------------------------- 1 | var semver = require('semver') 2 | var chalk = require('chalk') 3 | var packageConfig = require('../package.json') 4 | var exec = function (cmd) { 5 | return require('child_process') 6 | .execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | { 16 | name: 'npm', 17 | currentVersion: exec('npm --version'), 18 | versionRequirement: packageConfig.engines.npm 19 | } 20 | ] 21 | 22 | module.exports = function () { 23 | var warnings = [] 24 | for (var i = 0; i < versionRequirements.length; i++) { 25 | var mod = versionRequirements[i] 26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 27 | warnings.push(mod.name + ': ' + 28 | chalk.red(mod.currentVersion) + ' should be ' + 29 | chalk.green(mod.versionRequirement) 30 | ) 31 | } 32 | } 33 | 34 | if (warnings.length) { 35 | console.log('') 36 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 37 | console.log() 38 | for (var i = 0; i < warnings.length; i++) { 39 | var warning = warnings[i] 40 | console.log(' ' + warning) 41 | } 42 | console.log() 43 | process.exit(1) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/README.md: -------------------------------------------------------------------------------- 1 | # CloudVue 2 | ### 简介 3 | ``` 4 | CloudVue是一套基于Vue全家桶(Vue2.x + Vue-router2.x + Vuex)+ Thinkphp的前后端分离框架。 5 | 脚手架构建也可以通过vue官方的vue-cli脚手架工具构建 6 | 实现了一般后台所需要的功能模块 7 | 8 | * 登录、退出登录 9 | * 修改密码、记住密码 10 | * 菜单管理 11 | * 系统参数 12 | * 权限节点 13 | * 岗位管理 14 | * 部门管理 15 | * 用户组管理 16 | * 用户管理 17 | ``` 18 | 19 | ### 开发依赖 20 | * vue 21 | * element-ui 22 | * axios 23 | * fontawesome 24 | * js-cookie 25 | * lockr 26 | * lodash 27 | * moment 28 | 29 | 30 | ### 数据交互 31 | 数据交互通过axios以及RESTful架构来实现 32 | 33 | 用户校验通过登录返回的auth_key放在header 34 | 35 | 值得注意的一点是:跨域的情况下,会有预请求OPTION的情况 36 | 37 | 附上接口文档: 38 | 39 | 40 | ### 前端部署 41 | ``` 42 | 部署前准备 43 | 1.安装node.js 44 |  前端部分是基于node.js上运行的,所以必须先安装node.js,版本要求为6.9.0以上(推荐安装官方推荐版本),下载地址:https://nodejs.org/zh-cn/ 45 | 46 | 完成以上两个步骤之后,我们进入到frontEnd这个目录,然后按顺序执行以下两行代码就可以愉快地玩耍了。 47 | npm install 48 | npm run dev 49 | 50 | 注意:前端服务启动,默认会占用8080端口,所以在启动前端服务之前,请确认8080端口没有被占用。 51 | 如果想替换前端默认端口,可修改config/index.js里面的dev对象的port参数,但不建议这么做。 52 | 另外接口请求本地服务的端口是80端口,如果配置后端服务的时候启动的不是80端口,可在build/webpack.base.conf.js里修改DEV_HOST(开发环境请求地址)。 53 | ``` 54 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Common/leftMenu.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/conf/CaptchaConfig.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.conf; 2 | 3 | import java.util.Properties; 4 | 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | import com.google.code.kaptcha.impl.DefaultKaptcha; 9 | import com.google.code.kaptcha.util.Config; 10 | 11 | @Configuration 12 | public class CaptchaConfig { 13 | 14 | @Bean(name="captchaProducer") 15 | public DefaultKaptcha getKaptchaBean(){ 16 | DefaultKaptcha defaultKaptcha=new DefaultKaptcha(); 17 | Properties properties=new Properties(); 18 | properties.setProperty("kaptcha.border", "yes"); 19 | properties.setProperty("kaptcha.border.color", "105,179,90"); 20 | properties.setProperty("kaptcha.textproducer.font.color", "blue"); 21 | properties.setProperty("kaptcha.image.width", "125"); 22 | properties.setProperty("kaptcha.image.height", "45"); 23 | properties.setProperty("kaptcha.session.key", "code"); 24 | properties.setProperty("kaptcha.textproducer.char.length", "4"); 25 | properties.setProperty("kaptcha.textproducer.font.names", "宋体,楷体,微软雅黑"); 26 | Config config=new Config(properties); 27 | defaultKaptcha.setConfig(config); 28 | return defaultKaptcha; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'] 18 | }, 19 | dev: { 20 | env: require('./dev.env'), 21 | port: 8080, 22 | assetsSubDirectory: 'static', 23 | assetsPublicPath: '/', 24 | proxyTable: { 25 | '/api': { 26 | target: 'http://localhost:80', 27 | pathRewrite: { 28 | '^/api': '/' 29 | } 30 | } 31 | }, 32 | // CSS Sourcemaps off by default because relative paths are "buggy" 33 | // with this option, according to the CSS-Loader README 34 | // (https://github.com/webpack/css-loader#sourcemaps) 35 | // In our experience, they generally work as expected, 36 | // just be aware of this issue when enabling this option. 37 | cssSourceMap: false 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/js/global.js: -------------------------------------------------------------------------------- 1 | const commonFn = { 2 | j2s(obj) { 3 | return JSON.stringify(obj) 4 | }, 5 | shallowRefresh(name) { 6 | router.replace({ path: '/refresh', query: { name: name }}) 7 | }, 8 | closeGlobalLoading() { 9 | setTimeout(() => { 10 | store.dispatch('showLoading', false) 11 | }, 0) 12 | }, 13 | openGlobalLoading() { 14 | setTimeout(() => { 15 | store.dispatch('showLoading', true) 16 | }, 0) 17 | }, 18 | cloneJson(obj) { 19 | return JSON.parse(JSON.stringify(obj)) 20 | }, 21 | toastMsg(type, msg) { 22 | switch (type) { 23 | case 'normal': 24 | bus.$message(msg) 25 | break 26 | case 'success': 27 | bus.$message({ 28 | message: msg, 29 | type: 'success' 30 | }) 31 | break 32 | case 'warning': 33 | bus.$message({ 34 | message: msg, 35 | type: 'warning' 36 | }) 37 | break 38 | case 'error': 39 | bus.$message.error(msg) 40 | break 41 | } 42 | }, 43 | clearVuex(cate) { 44 | store.dispatch(cate, []) 45 | }, 46 | getHasRule(val) { 47 | const moduleRule = 'admin' 48 | let userInfo = Lockr.get('userInfo') 49 | if (userInfo.id == 1) { 50 | return true 51 | } else { 52 | let authList = moduleRule + Lockr.get('authList') 53 | return _.includes(authList, val) 54 | } 55 | } 56 | } 57 | 58 | export default commonFn 59 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/mappers/SysAdminUserDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/model/SysAdminStructure.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.model; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Table; 5 | 6 | import cloud.simple.service.base.BaseEntity; 7 | 8 | @Table(name = "`sys_admin_structure`") 9 | public class SysAdminStructure extends BaseEntity { 10 | private static final long serialVersionUID = 8560760088975512813L; 11 | 12 | @Column(name = "`name`") 13 | private String name; 14 | 15 | @Column(name = "`pid`") 16 | private Integer pid; 17 | 18 | @Column(name = "`status`") 19 | private Byte status; 20 | 21 | 22 | /** 23 | * @return name 24 | */ 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | /** 30 | * @param name 31 | */ 32 | public void setName(String name) { 33 | this.name = name; 34 | } 35 | 36 | /** 37 | * @return pid 38 | */ 39 | public Integer getPid() { 40 | return pid; 41 | } 42 | 43 | /** 44 | * @param pid 45 | */ 46 | public void setPid(Integer pid) { 47 | this.pid = pid; 48 | } 49 | 50 | /** 51 | * @return status 52 | */ 53 | public Byte getStatus() { 54 | return status; 55 | } 56 | 57 | /** 58 | * @param status 59 | */ 60 | public void setStatus(Byte status) { 61 | this.status = status; 62 | } 63 | } -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/web/CommonController.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.web; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.apache.commons.lang3.StringUtils; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.context.request.RequestContextHolder; 8 | import org.springframework.web.context.request.ServletRequestAttributes; 9 | 10 | import cloud.simple.service.contants.Constant; 11 | import cloud.simple.service.domain.SysAdminUserService; 12 | import cloud.simple.service.model.SysAdminUser; 13 | import cloud.simple.service.util.EncryptUtil; 14 | 15 | /** 16 | * 公共控制器 17 | * @author leo 18 | * 19 | */ 20 | public class CommonController { 21 | @Autowired 22 | private SysAdminUserService sysAdminUserService; 23 | 24 | 25 | /** 26 | * 获取当前登录用户 27 | * @return 28 | */ 29 | public SysAdminUser getCurrentUser(){ 30 | HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); 31 | String authKey = request.getHeader(Constant.AUTH_KEY); 32 | if(StringUtils.isNotBlank(authKey)) { 33 | String decryptAuthKey = EncryptUtil.decryptBase64(authKey, Constant.SECRET_KEY); 34 | String[] auths = decryptAuthKey.split("\\|"); 35 | String username = auths[0]; 36 | String password = auths[1]; 37 | SysAdminUser record = new SysAdminUser(); 38 | record.setUsername(username); 39 | record.setPassword(password); 40 | return sysAdminUserService.selectOne(record); 41 | } 42 | return null; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/web/SysConfigController.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.web; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | import cloud.simple.service.domain.SysSystemConfigService; 16 | import cloud.simple.service.model.SysSystemConfig; 17 | import cloud.simple.service.util.FastJsonUtils; 18 | import io.swagger.annotations.Api; 19 | import io.swagger.annotations.ApiOperation; 20 | 21 | /** 22 | * 系统配置 控制层 23 | * @author leo.aqing 24 | */ 25 | @RestController 26 | @RequestMapping("/admin") 27 | @Api(value = "SysConfigController", description = "系统配置接口") 28 | public class SysConfigController extends CommonController{ 29 | @Autowired 30 | private SysSystemConfigService sysSystemConfigService; 31 | 32 | @ApiOperation(value = "获取配置", httpMethod="POST") 33 | @PostMapping(value = "/configs", produces = {"application/json;charset=UTF-8"}) 34 | public String configs(@RequestBody(required=false) SysSystemConfig record,HttpServletRequest request) { 35 | Map data = new HashMap(); 36 | List configs = sysSystemConfigService.select(record); 37 | for (SysSystemConfig c : configs) { 38 | data.put(c.getName(), c.getValue()); 39 | } 40 | return FastJsonUtils.resultSuccess(200, "查询配置成功", data); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/domain/SysAdminGroupService.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.domain; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.google.common.collect.Lists; 10 | import com.google.common.collect.Maps; 11 | 12 | import cloud.simple.service.base.BaseServiceImpl; 13 | import cloud.simple.service.dao.SysAdminGroupDao; 14 | import cloud.simple.service.model.SysAdminGroup; 15 | import cloud.simple.service.util.BeanToMapUtil; 16 | import cloud.simple.service.util.Category; 17 | import tk.mybatis.mapper.common.Mapper; 18 | import tk.mybatis.mapper.entity.Example; 19 | @Service 20 | public class SysAdminGroupService extends BaseServiceImpl{ 21 | @Autowired 22 | private SysAdminGroupDao sysAdminGroupDao; 23 | 24 | @Override 25 | public Mapper getMapper() { 26 | return sysAdminGroupDao; 27 | } 28 | /** 29 | * 列表 30 | * @return 31 | */ 32 | public List> getDataList() { 33 | Example example = new Example(SysAdminGroup.class); 34 | List rootSysAdminGroups = sysAdminGroupDao.selectByExample(example); 35 | Map fields = Maps.newHashMap(); 36 | fields.put("cid", "id"); 37 | fields.put("fid", "pid"); 38 | fields.put("name", "title"); 39 | fields.put("fullname", "title"); 40 | List> rawList = Lists.newArrayList(); 41 | rootSysAdminGroups.forEach((m)->{ 42 | rawList.add(BeanToMapUtil.convertBean(m)); 43 | }); 44 | Category cate = new Category(fields, rawList); 45 | return cate.getList(Integer.valueOf("0")); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/web/UploadController.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.web; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.ui.ModelMap; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RestController; 11 | import org.springframework.web.multipart.MultipartFile; 12 | 13 | import cloud.simple.service.util.FastJsonUtils; 14 | import cloud.simple.service.util.UploadUtils; 15 | import io.swagger.annotations.Api; 16 | import io.swagger.annotations.ApiOperation; 17 | 18 | /** 19 | * 文件上传控制器 20 | * 21 | * @author ShenHuaJie 22 | * @version 2016年5月20日 下午3:11:42 23 | */ 24 | @RestController 25 | @Api(value = "文件上传接口", description = "文件上传接口") 26 | @RequestMapping(value = "/upload", method = RequestMethod.POST) 27 | public class UploadController extends CommonController { 28 | 29 | @Value("${spring.http.multipart.location}") 30 | private String multipartLocation; 31 | 32 | // 上传文件(支持批量) 33 | @RequestMapping("/image") 34 | @ApiOperation(value = "上传图片", httpMethod="POST") 35 | public String uploadImage(MultipartFile file, HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) { 36 | response.setHeader("Access-Control-Allow-Origin", "*"); 37 | response.setContentType("text/html;charset=utf-8"); 38 | //上传文件 39 | String path = UploadUtils.saveMartipartFile(multipartLocation, request,file,"users","yyyyMM"); 40 | return FastJsonUtils.resultSuccess(1, "上传成功",path); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/mappers/SysAdminMenuDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 31 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/domain/SysAdminStructureService.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.domain; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.google.common.collect.Lists; 10 | import com.google.common.collect.Maps; 11 | 12 | import cloud.simple.service.base.BaseServiceImpl; 13 | import cloud.simple.service.dao.SysAdminStructureDao; 14 | import cloud.simple.service.model.SysAdminStructure; 15 | import cloud.simple.service.util.BeanToMapUtil; 16 | import cloud.simple.service.util.Category; 17 | import tk.mybatis.mapper.common.Mapper; 18 | import tk.mybatis.mapper.entity.Example; 19 | @Service 20 | public class SysAdminStructureService extends BaseServiceImpl{ 21 | 22 | @Autowired 23 | private SysAdminStructureDao sysAdminStructureDao; 24 | 25 | @Override 26 | public Mapper getMapper() { 27 | return sysAdminStructureDao; 28 | } 29 | 30 | public List> getDataList() { 31 | Example example = new Example(SysAdminStructure.class); 32 | example.setOrderByClause(" id asc"); 33 | List rootSysAdminStructure = sysAdminStructureDao.selectByExample(example); 34 | Map fields = Maps.newHashMap(); 35 | fields.put("cid", "id"); 36 | fields.put("fid", "pid"); 37 | fields.put("name", "name"); 38 | fields.put("fullname", "title"); 39 | List> rawList = Lists.newArrayList(); 40 | rootSysAdminStructure.forEach((m)->{ 41 | rawList.add(BeanToMapUtil.convertBean(m)); 42 | }); 43 | Category cate = new Category(fields, rawList); 44 | return cate.getList(Integer.valueOf("0")); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/conf/Swagger2Config.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.conf; 2 | 3 | import java.time.LocalDate; 4 | 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.http.ResponseEntity; 8 | 9 | import springfox.documentation.builders.ApiInfoBuilder; 10 | import springfox.documentation.builders.PathSelectors; 11 | import springfox.documentation.builders.RequestHandlerSelectors; 12 | import springfox.documentation.service.ApiInfo; 13 | import springfox.documentation.spi.DocumentationType; 14 | import springfox.documentation.spring.web.plugins.Docket; 15 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 16 | 17 | @Configuration 18 | @EnableSwagger2 19 | public class Swagger2Config { 20 | /** 21 | * 通过 createRestApi函数来构建一个DocketBean 22 | * 函数名,可以随意命名,喜欢什么命名就什么命名 23 | */ 24 | @Bean 25 | public Docket createRestApi() { 26 | return new Docket(DocumentationType.SWAGGER_2) 27 | .apiInfo(apiInfo()) 28 | .select() 29 | .apis(RequestHandlerSelectors.basePackage("cloud.simple.service")) 30 | .paths(PathSelectors.any()) 31 | .build() 32 | .pathMapping("/") 33 | .directModelSubstitute(LocalDate.class, String.class) 34 | .genericModelSubstitutes(ResponseEntity.class) 35 | .useDefaultResponseMessages(false) 36 | .enableUrlTemplating(true); 37 | } 38 | //构建 api文档的详细信息函数 39 | @SuppressWarnings("deprecation") 40 | private ApiInfo apiInfo() { 41 | return new ApiInfoBuilder() 42 | //页面标题 43 | .title("SpringCloud + vue RESTful API") 44 | //创建人 45 | .contact("leo.aqing") 46 | //版本号 47 | .version("1.0") 48 | //描述 49 | .description("API 描述") 50 | .build(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/dto/TreeNode.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.dto; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | 6 | public class TreeNode extends HashMap{ 7 | private static final long serialVersionUID = 2740636334980858843L; 8 | 9 | private String id; 10 | 11 | private String parentId; 12 | 13 | private String name; 14 | 15 | private List children; 16 | 17 | public TreeNode(String id, String name, String parentId) { 18 | this.id = id; 19 | this.parentId = parentId; 20 | this.name = name; 21 | } 22 | public TreeNode(String id, String name, TreeNode parent) { 23 | this.id = id; 24 | this.parentId = parent.getId(); 25 | this.name = name; 26 | } 27 | 28 | 29 | public String getParentId() { 30 | return parentId; 31 | } 32 | 33 | public void setParentId(String parentId) { 34 | this.parentId = parentId; 35 | } 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public void setName(String name) { 42 | this.name = name; 43 | } 44 | 45 | public String getId() { 46 | return id; 47 | } 48 | 49 | public void setId(String id) { 50 | this.id = id; 51 | } 52 | 53 | public List getChildren() { 54 | return children; 55 | } 56 | 57 | public void setChildren(List children) { 58 | this.children = children; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return "TreeNode{" + 64 | "id='" + id + '\'' + 65 | ", parentId='" + parentId + '\'' + 66 | ", name='" + name + '\'' + 67 | ", children=" + children + 68 | '}'; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/position/add.vue: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/util/UploadUtils.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.util; 2 | 3 | import java.io.File; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | import java.util.UUID; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | import org.apache.commons.io.FilenameUtils; 11 | import org.apache.commons.lang.StringUtils; 12 | import org.springframework.web.multipart.MultipartFile; 13 | 14 | /** 15 | * 上传工具类 16 | * @version 1.0 17 | */ 18 | public class UploadUtils { 19 | 20 | public static final String allowUploadImageType = "jpg,jpge,bmp,gif,png"; 21 | 22 | public static String saveMartipartFile(String multipartLocation, HttpServletRequest request,MultipartFile file) { 23 | return saveMartipartFile(multipartLocation, request, file, null, "yyyyMMdd"); 24 | } 25 | 26 | public static String saveMartipartFile(String multipartLocation, HttpServletRequest request,MultipartFile file,String module) { 27 | return saveMartipartFile(multipartLocation, request, file, module, "yyyyMMdd"); 28 | } 29 | 30 | public static String saveMartipartFile(String multipartLocation,HttpServletRequest request,MultipartFile file,String module,String format) { 31 | try { 32 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); 33 | String dateString = simpleDateFormat.format(new Date()); 34 | File dir = new File(multipartLocation+"/upload/" + (StringUtils.isNotEmpty(module) == true ? module+"/"+dateString:dateString)); 35 | if (!dir.exists()) { 36 | if (!dir.mkdirs()) { 37 | throw new Exception("创建保存目录失败"); 38 | } 39 | } 40 | String fileName = UUID.randomUUID().toString() + "." 41 | + FilenameUtils.getExtension(file.getOriginalFilename()).toLowerCase(); 42 | file.transferTo(new File(dir, fileName)); 43 | return "/upload/" +(StringUtils.isNotEmpty(module) == true ? module+"/"+dateString:dateString) + "/" + fileName; 44 | } catch (Exception e) { 45 | e.printStackTrace(); 46 | } 47 | return null; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cloud-vue", 3 | "version": "1.0.0", 4 | "description": "cloud-vue made by vue2.0", 5 | "scripts": { 6 | "dev": "node build/dev-server.js", 7 | "build": "node build/build.js" 8 | }, 9 | "dependencies": { 10 | "axios": "^0.15.3", 11 | "element-ui": "1.2.7", 12 | "font-awesome": "^4.7.0", 13 | "js-cookie": "^2.1.3", 14 | "lockr": "^0.8.4", 15 | "lodash": "^4.17.2", 16 | "moment": "^2.17.1", 17 | "nprogress": "^0.2.0", 18 | "query-string": "^4.2.3", 19 | "vee-validate": "^2.0.0-beta.17", 20 | "vue": "^2.0.7", 21 | "vuex": "^2.0.0-rc.6" 22 | }, 23 | "devDependencies": { 24 | "autoprefixer": "^6.4.0", 25 | "babel-cli": "^6.18.0", 26 | "babel-core": "^6.0.0", 27 | "babel-eslint": "^7.1.1", 28 | "babel-loader": "^6.2.8", 29 | "babel-plugin-transform-runtime": "^6.0.0", 30 | "babel-polyfill": "^6.20.0", 31 | "babel-preset-es2015": "^6.0.0", 32 | "babel-preset-stage-3": "^6.17.0", 33 | "babel-register": "^6.0.0", 34 | "babel-runtime": "^6.20.0", 35 | "chalk": "^1.1.3", 36 | "connect-history-api-fallback": "^1.1.0", 37 | "css-loader": "^0.26.0", 38 | "eslint": "^3.12.2", 39 | "eslint-config-vue": "^2.0.1", 40 | "eslint-loader": "^1.6.1", 41 | "eslint-plugin-vue": "^1.0.0", 42 | "eventsource-polyfill": "^0.9.6", 43 | "express": "^4.13.3", 44 | "extract-text-webpack-plugin": "^1.0.1", 45 | "file-loader": "^0.9.0", 46 | "function-bind": "^1.0.2", 47 | "html-webpack-plugin": "^2.8.1", 48 | "http-proxy-middleware": "^0.17.2", 49 | "json-loader": "^0.5.4", 50 | "opn": "^4.0.2", 51 | "ora": "^0.3.0", 52 | "semver": "^5.3.0", 53 | "shelljs": "^0.7.4", 54 | "url-loader": "^0.5.7", 55 | "vue-loader": "^9.9.5", 56 | "vue-router": "^2.0.3", 57 | "vue-style-loader": "^1.0.0", 58 | "webpack": "^1.13.2", 59 | "webpack-dev-middleware": "^1.8.3", 60 | "webpack-hot-middleware": "^2.12.2", 61 | "webpack-merge": "^0.17.0" 62 | }, 63 | "engines": { 64 | "node": ">= 4.0.0", 65 | "npm": ">= 3.0.0" 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # spring-cloud-vue 2 | --- 3 | 4 | ## 项目简介 5 | * cloud-vue是一套基于springcloud + mybatis + vue全家桶(Vue2.x + Vue-router2.x + Vuex)的前后端分离框架. 6 | * 使用Maven对项目进行模块化管理,提高项目的易开发性、扩展性。 7 | * 系统包括分布式配置、eureka注册中心、服务中心、zipkin分布式跟踪等。 8 | * 每个模块服务多系统部署,注册到同一个eureka集群服务注册中心,实现集群部署。 9 | 10 | ## 主要功能 11 | * 登录、退出登录 12 | * 修改密码、记住密码 13 | * 菜单管理 14 | * 系统参数 15 | * 权限节点 16 | * 岗位管理 17 | * 部门管理 18 | * 用户组管理 19 | * 用户管理 20 | 21 | ## 依赖 22 | ### java后端依赖环境 23 | * Maven 3 24 | * Java 8 25 | * MySQL 5.7 26 | * Docker 1.13.1 (不是必须的) 27 | 28 | ### vue2前端依赖环境 29 | * node >= 6.9.0 30 | * npm >= 3.0.0 31 | * vue 32 | * element-ui@1.1.3 33 | * axios 34 | * fontawesome 35 | * js-cookie 36 | * lockr 37 | * lodash 38 | * moment 39 | 40 | ## 工程说明 41 | * cloud-config-server:配置中心。 42 | * cloud-eureka-server:注册中心。 43 | * cloud-simple-service:自定义的微服务。 44 | * cloud-zipkin-ui:分布式链路调用监控系统,聚合各业务系统调用延迟数据,达到链路调用监控跟踪。 45 | * cloud-vue : vue(Vue2.x + Vue-router2.x + Vuex)的前端项目 46 | 47 | ## 部署说明 48 | * 导入cloud-simple-service的cloud-vue.sql到mysql数据库。 49 | * 修改cloud-config-repo与cloud-zipkin-ui中的数据库配置文件 50 | * 打包命令 mvn package -DskipDockerBuild 51 | * 依次启动cloud-eureka-server-1.0.0.jar、cloud-config-server-1.0.0.jar、cloud-zipkin-ui-1.0.0.jar、cloud-simple-service-1.0.0.jar。 52 | * 端口:配置中心端口(1111)、注册中心(8888)、rest服务(80)、zipkin服务(9012)、UI前端(8080),如果端口冲突请自行修改。 53 | 54 | ## 效果图 55 | ![登录](./pic/登录.png) 56 | 57 | ![部门管理](./pic/部门管理.png) 58 | 59 | ![部门管理](./pic/部门管理.png) 60 | 61 | ![菜单管理](./pic/菜单管理.png) 62 | 63 | ![岗位管理](./pic/岗位管理.png) 64 | 65 | ![权限规则管理](./pic/权限规则管理.png) 66 | 67 | ![用户组管理](./pic/用户组管理.png) 68 | 69 | ![注册中心](./pic/注册中心.png) 70 | 71 | ![swagger](./pic/swagger.png) 72 | 73 | ![zipkin](./pic/zipkin.png) 74 | 75 | ## License 76 | cloud-vue 基于apache2.0 77 | 78 | 如果项目对您有用,请作者喝杯咖啡吧! 79 | 80 | ![支付二维码](./pic/二维码.jpg) 81 | 82 | 83 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/main.js: -------------------------------------------------------------------------------- 1 | import 'babel-polyfill' 2 | import Vue from 'vue' 3 | import App from './App' 4 | import axios from 'axios' 5 | import Lockr from 'lockr' 6 | import Cookies from 'js-cookie' 7 | import _ from 'lodash' 8 | import moment from 'moment' 9 | import ElementUI from 'element-ui' 10 | import 'element-ui/lib/theme-default/index.css' 11 | import routes from './routes' 12 | import VueRouter from 'vue-router' 13 | import store from './vuex/store' 14 | import filter from './assets/js/filter' 15 | import _g from './assets/js/global' 16 | import NProgress from 'nprogress' 17 | import 'nprogress/nprogress.css' 18 | import 'assets/css/global.css' 19 | import 'assets/css/base.css' 20 | 21 | axios.defaults.baseURL = HOST 22 | axios.defaults.timeout = 1000 * 15 23 | axios.defaults.headers.authKey = Lockr.get('authKey') 24 | axios.defaults.headers.sessionId = Lockr.get('sessionId') 25 | axios.defaults.headers['Content-Type'] = 'application/json' 26 | 27 | axios.interceptors.request.use(function (config) { // 这里的config包含每次请求的内容 28 | if (store.state.authKey) { 29 | config.headers.authKey = Lockr.get('authKey') 30 | } 31 | return config 32 | }, function (err) { 33 | return Promise.reject(err) 34 | }) 35 | 36 | const router = new VueRouter({ 37 | mode: 'history', 38 | base: __dirname, 39 | routes 40 | }) 41 | 42 | router.beforeEach((to, from, next) => { 43 | console.log("to:" + to) 44 | console.log("from:" + from) 45 | const hideLeft = to.meta.hideLeft 46 | store.dispatch('showLeftMenu', hideLeft) 47 | store.dispatch('showLoading', true) 48 | NProgress.start() 49 | next() 50 | }) 51 | router.afterEach(transition => { 52 | NProgress.done() 53 | }) 54 | 55 | Vue.use(ElementUI) 56 | Vue.use(VueRouter) 57 | 58 | window.router = router 59 | window.store = store 60 | window.HOST = HOST 61 | window.axios = axios 62 | window._ = _ 63 | window.moment = moment 64 | window.Lockr = Lockr 65 | window.Cookies = Cookies 66 | window._g = _g 67 | window.pageSize = 15 68 | 69 | const bus = new Vue() 70 | window.bus = bus 71 | 72 | new Vue({ 73 | el: '#app', 74 | template: '', 75 | filters: filter, 76 | router, 77 | store, 78 | components: { App } 79 | // render: h => h(Login) 80 | }).$mount('#app') 81 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/conf/DruidAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.conf; 2 | 3 | import java.sql.SQLException; 4 | 5 | import javax.sql.DataSource; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.autoconfigure.AutoConfigureBefore; 9 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; 10 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 11 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; 12 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 13 | import org.springframework.context.annotation.Bean; 14 | import org.springframework.context.annotation.Configuration; 15 | 16 | import com.alibaba.druid.pool.DruidDataSource; 17 | 18 | @Configuration 19 | @EnableConfigurationProperties(DruidProperties.class) 20 | @ConditionalOnClass(DruidDataSource.class) 21 | @ConditionalOnProperty(prefix = "druid", name = "url") 22 | @AutoConfigureBefore(DataSourceAutoConfiguration.class) 23 | public class DruidAutoConfiguration { 24 | 25 | @Autowired 26 | private DruidProperties properties; 27 | 28 | @Bean 29 | public DataSource dataSource() { 30 | DruidDataSource dataSource = new DruidDataSource(); 31 | dataSource.setUrl(properties.getUrl()); 32 | dataSource.setUsername(properties.getUsername()); 33 | dataSource.setPassword(properties.getPassword()); 34 | if (properties.getInitialSize() > 0) { 35 | dataSource.setInitialSize(properties.getInitialSize()); 36 | } 37 | if (properties.getMinIdle() > 0) { 38 | dataSource.setMinIdle(properties.getMinIdle()); 39 | } 40 | if (properties.getMaxActive() > 0) { 41 | dataSource.setMaxActive(properties.getMaxActive()); 42 | } 43 | dataSource.setTestOnBorrow(properties.isTestOnBorrow()); 44 | try { 45 | dataSource.init(); 46 | } catch (SQLException e) { 47 | throw new RuntimeException(e); 48 | } 49 | return dataSource; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/model/SysAdminGroup.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.model; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Table; 5 | 6 | import cloud.simple.service.base.BaseEntity; 7 | 8 | @Table(name = "`sys_admin_group`") 9 | public class SysAdminGroup extends BaseEntity { 10 | private static final long serialVersionUID = 4199719159643822719L; 11 | 12 | @Column(name = "`title`") 13 | private String title; 14 | 15 | @Column(name = "`rules`") 16 | private String rules; 17 | 18 | @Column(name = "`pid`") 19 | private Integer pid; 20 | 21 | @Column(name = "`remark`") 22 | private String remark; 23 | 24 | @Column(name = "`status`") 25 | private Byte status; 26 | 27 | 28 | /** 29 | * @return title 30 | */ 31 | public String getTitle() { 32 | return title; 33 | } 34 | 35 | /** 36 | * @param title 37 | */ 38 | public void setTitle(String title) { 39 | this.title = title; 40 | } 41 | 42 | /** 43 | * @return rules 44 | */ 45 | public String getRules() { 46 | return rules; 47 | } 48 | 49 | /** 50 | * @param rules 51 | */ 52 | public void setRules(String rules) { 53 | this.rules = rules; 54 | } 55 | 56 | /** 57 | * @return pid 58 | */ 59 | public Integer getPid() { 60 | return pid; 61 | } 62 | 63 | /** 64 | * @param pid 65 | */ 66 | public void setPid(Integer pid) { 67 | this.pid = pid; 68 | } 69 | 70 | /** 71 | * @return remark 72 | */ 73 | public String getRemark() { 74 | return remark; 75 | } 76 | 77 | /** 78 | * @param remark 79 | */ 80 | public void setRemark(String remark) { 81 | this.remark = remark; 82 | } 83 | 84 | /** 85 | * @return status 86 | */ 87 | public Byte getStatus() { 88 | return status; 89 | } 90 | 91 | /** 92 | * @param status 93 | */ 94 | public void setStatus(Byte status) { 95 | this.status = status; 96 | } 97 | } -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/conf/DruidProperties.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.conf; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | 5 | /** 6 | * 只提供了常用的属性,如果有需要,自己添加 7 | * 8 | */ 9 | @ConfigurationProperties(prefix = "druid") 10 | public class DruidProperties { 11 | private String url; 12 | private String username; 13 | private String password; 14 | private String driverClass; 15 | 16 | private int maxActive; 17 | private int minIdle; 18 | private int initialSize; 19 | private boolean testOnBorrow; 20 | 21 | public String getUrl() { 22 | return url; 23 | } 24 | 25 | public void setUrl(String url) { 26 | this.url = url; 27 | } 28 | 29 | public String getUsername() { 30 | return username; 31 | } 32 | 33 | public void setUsername(String username) { 34 | this.username = username; 35 | } 36 | 37 | public String getPassword() { 38 | return password; 39 | } 40 | 41 | public void setPassword(String password) { 42 | this.password = password; 43 | } 44 | 45 | public String getDriverClass() { 46 | return driverClass; 47 | } 48 | 49 | public void setDriverClass(String driverClass) { 50 | this.driverClass = driverClass; 51 | } 52 | 53 | public int getMaxActive() { 54 | return maxActive; 55 | } 56 | 57 | public void setMaxActive(int maxActive) { 58 | this.maxActive = maxActive; 59 | } 60 | 61 | public int getMinIdle() { 62 | return minIdle; 63 | } 64 | 65 | public void setMinIdle(int minIdle) { 66 | this.minIdle = minIdle; 67 | } 68 | 69 | public int getInitialSize() { 70 | return initialSize; 71 | } 72 | 73 | public void setInitialSize(int initialSize) { 74 | this.initialSize = initialSize; 75 | } 76 | 77 | public boolean isTestOnBorrow() { 78 | return testOnBorrow; 79 | } 80 | 81 | public void setTestOnBorrow(boolean testOnBorrow) { 82 | this.testOnBorrow = testOnBorrow; 83 | } 84 | } -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/css/base.css: -------------------------------------------------------------------------------- 1 | .top-menu:hover { 2 | cursor: pointer; 3 | background: #324057; 4 | /*color: #20a0ff;*/ 5 | } 6 | .top-menu:active, .left-menu:active { 7 | color: #20a0ff; 8 | } 9 | .top-active { 10 | color: #44B5DF 11 | } 12 | .top-menu, .left-menu { 13 | user-select:none; 14 | -webkit-user-select:none; 15 | -moz-user-select:none; 16 | -o-user-select:none; 17 | -ms-user-select:none; 18 | } 19 | .left-menu:hover { 20 | background: #42566C; 21 | } 22 | .pages { 23 | position: absolute; 24 | top: 20px; 25 | right: -5px; 26 | } 27 | .btn-link,.btn-link-large { 28 | display: inline-block; 29 | line-height: 1; 30 | color: #fff; 31 | white-space: nowrap; 32 | cursor: pointer; 33 | text-align: center; 34 | box-sizing: border-box; 35 | margin-right: 10px; 36 | padding: 7px 9px; 37 | font-size: 12px; 38 | border-radius: 4px; 39 | } 40 | .btn-link-large { 41 | margin: 0; 42 | padding: 10px 15px; 43 | font-size: 14px; 44 | } 45 | .add-btn { 46 | background: #4caf50 47 | } 48 | .add-btn:hover { 49 | background: #66bb6a 50 | } 51 | .add-btn:active { 52 | background: #43a047 53 | } 54 | .edit-btn { 55 | background: #339df7 56 | } 57 | .edit-btn:hover { 58 | background: #5bb1fa 59 | } 60 | .edit-btn:active { 61 | background: #047ce2 62 | } 63 | .user-menu { 64 | position: absolute; 65 | top: 0px; 66 | right: 100px; 67 | } 68 | .add-btn-right { 69 | position: absolute; 70 | top: 0px; 71 | right: 0px; 72 | } 73 | .table-head { 74 | position: relative; 75 | display: block; 76 | width: 100%; 77 | height: 30px; 78 | line-height: 30px; 79 | color: #fff; 80 | background: #515151 81 | } 82 | .table-head > .title { 83 | color: #fff; 84 | padding-left: 10px; 85 | } 86 | .table-head > .icon { 87 | position: absolute; 88 | font-size: 20px; 89 | top: 6px; 90 | right: 10px; 91 | cursor: pointer; 92 | } 93 | .table-head > .table-head-btn { 94 | position: absolute; 95 | top: 4px; 96 | right: 10px; 97 | } 98 | .table-head > .table-head-btn:last-child { 99 | right: 55px; 100 | } 101 | .form-title { 102 | padding-bottom: 10px; 103 | font-weight: bold; 104 | font-size: 20px; 105 | border-bottom: 1px solid #ccc; 106 | } -------------------------------------------------------------------------------- /fore-end/cloud-vue/build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | // generate loader string to be used with extract text plugin 15 | function generateLoaders (loaders) { 16 | var sourceLoader = loaders.map(function (loader) { 17 | var extraParamChar 18 | if (/\?/.test(loader)) { 19 | loader = loader.replace(/\?/, '-loader?') 20 | extraParamChar = '&' 21 | } else { 22 | loader = loader + '-loader' 23 | extraParamChar = '?' 24 | } 25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') 26 | }).join('!') 27 | 28 | // Extract CSS when that option is specified 29 | // (which is the case during production build) 30 | if (options.extract) { 31 | return ExtractTextPlugin.extract('vue-style-loader', sourceLoader) 32 | } else { 33 | return ['vue-style-loader', sourceLoader].join('!') 34 | } 35 | } 36 | 37 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html 38 | return { 39 | css: generateLoaders(['css']), 40 | postcss: generateLoaders(['css']), 41 | less: generateLoaders(['css', 'less']), 42 | sass: generateLoaders(['css', 'sass?indentedSyntax']), 43 | scss: generateLoaders(['css', 'sass']), 44 | stylus: generateLoaders(['css', 'stylus']), 45 | styl: generateLoaders(['css', 'stylus']), 46 | // 额外添加 47 | // js: 'babel!eslint' 48 | } 49 | } 50 | 51 | // Generate loaders for standalone style files (outside of .vue) 52 | exports.styleLoaders = function (options) { 53 | var output = [] 54 | var loaders = exports.cssLoaders(options) 55 | for (var extension in loaders) { 56 | var loader = loaders[extension] 57 | output.push({ 58 | test: new RegExp('\\.' + extension + '$'), 59 | loader: loader 60 | }) 61 | } 62 | return output 63 | } 64 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | var config = require('../config') 3 | if (!process.env.NODE_ENV) process.env.NODE_ENV = config.dev.env 4 | var path = require('path') 5 | var express = require('express') 6 | var webpack = require('webpack') 7 | var opn = require('opn') 8 | var proxyMiddleware = require('http-proxy-middleware') 9 | var webpackConfig = require('./webpack.dev.conf') 10 | 11 | // default port where dev server listens for incoming traffic 12 | var port = process.env.PORT || config.dev.port 13 | // Define HTTP proxies to your custom API backend 14 | // https://github.com/chimurai/http-proxy-middleware 15 | var proxyTable = config.dev.proxyTable 16 | 17 | var app = express() 18 | var compiler = webpack(webpackConfig) 19 | 20 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 21 | publicPath: webpackConfig.output.publicPath, 22 | stats: { 23 | colors: true, 24 | chunks: false 25 | } 26 | }) 27 | 28 | var hotMiddleware = require('webpack-hot-middleware')(compiler) 29 | // force page reload when html-webpack-plugin template changes 30 | compiler.plugin('compilation', function (compilation) { 31 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 32 | hotMiddleware.publish({ action: 'reload' }) 33 | cb() 34 | }) 35 | }) 36 | 37 | // proxy api requests 38 | Object.keys(proxyTable).forEach(function (context) { 39 | var options = proxyTable[context] 40 | if (typeof options === 'string') { 41 | options = { target: options } 42 | } 43 | app.use(proxyMiddleware(context, options)) 44 | }) 45 | 46 | // handle fallback for HTML5 history API 47 | app.use(require('connect-history-api-fallback')()) 48 | 49 | // serve webpack bundle output 50 | app.use(devMiddleware) 51 | 52 | // enable hot-reload and state-preserving 53 | // compilation error display 54 | app.use(hotMiddleware) 55 | 56 | // serve pure static assets 57 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 58 | app.use(staticPath, express.static('./static')) 59 | 60 | module.exports = app.listen(port, function (err) { 61 | if (err) { 62 | console.log(err) 63 | return 64 | } 65 | var uri = 'http://localhost:' + port 66 | console.log('Listening at ' + uri + '\n') 67 | opn(uri) 68 | }) 69 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/assets/js/filter.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | export default (function () { 3 | Vue.filter('status', function (value) { 4 | if (value == 1) { 5 | return '启用' 6 | } else if (value == 0) { 7 | return '禁用' 8 | } else { 9 | return '未知状态' 10 | } 11 | }) 12 | Vue.filter('rules', function (value) { 13 | return value 14 | }) 15 | Vue.filter('fileLink', function (value) { 16 | const link = window.imgUrl + value 17 | return link 18 | }) 19 | Vue.filter('toolType', function (value) { 20 | let type = '' 21 | if (value == 1) { 22 | type = '系统工具' 23 | } else if (value == 2) { 24 | type = '说明知道' 25 | } 26 | return type 27 | }) 28 | Vue.filter('numToString', function (value) { 29 | const string = value.toString() 30 | return string 31 | }) 32 | Vue.filter('projectState', function (value) { 33 | let string = '' 34 | switch (value) { 35 | case '1': 36 | string = '售前项目' 37 | break 38 | case '2': 39 | string = '服务中项目' 40 | break 41 | case '3': 42 | string = '已结束项目' 43 | break 44 | } 45 | return string 46 | }) 47 | Vue.filter('time', function (value) { 48 | let day = moment.unix(value) 49 | let date = moment(day).format('YYYY/MM/DD H:mm') 50 | return date 51 | }) 52 | Vue.filter('date', function (value) { 53 | let day = moment.unix(value) 54 | let date = moment(day).format('YYYY/MM/DD') 55 | return date 56 | }) 57 | Vue.filter('abstract', function (value) { 58 | let abstract = '' 59 | if (value.length > 70) { 60 | abstract = value.substr(0, 70) + '...' 61 | } else { 62 | abstract = value 63 | } 64 | return abstract 65 | }) 66 | Vue.filter('posStatus', function (value) { 67 | let status = '' 68 | switch (value) { 69 | case 1: 70 | status = '在职' 71 | break 72 | case 2: 73 | status = '待入职' 74 | break 75 | case 3: 76 | status = '离职' 77 | break 78 | } 79 | return status 80 | }) 81 | Vue.filter('template', function (value) { 82 | let template = '' 83 | if (value == '') { 84 | template = '上传' 85 | } else { 86 | template = '上传更新' 87 | } 88 | return template 89 | }) 90 | })() 91 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/structures/add.vue: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/model/SysSystemConfig.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.model; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Table; 5 | 6 | import cloud.simple.service.base.BaseEntity; 7 | 8 | @Table(name = "`sys_system_config`") 9 | public class SysSystemConfig extends BaseEntity { 10 | private static final long serialVersionUID = -3343040004793640240L; 11 | 12 | 13 | @Column(name = "`name`") 14 | private String name; 15 | 16 | /** 17 | * 配置值 18 | */ 19 | @Column(name = "`value`") 20 | private String value; 21 | 22 | /** 23 | * 配置分组 24 | */ 25 | @Column(name = "`group`") 26 | private Byte group; 27 | 28 | /** 29 | * 1需要登录后才能获取,0不需要登录即可获取 30 | */ 31 | @Column(name = "`need_auth`") 32 | private Byte needAuth; 33 | 34 | 35 | /** 36 | * @return name 37 | */ 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | /** 43 | * @param name 44 | */ 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | /** 50 | * 获取配置值 51 | * 52 | * @return value - 配置值 53 | */ 54 | public String getValue() { 55 | return value; 56 | } 57 | 58 | /** 59 | * 设置配置值 60 | * 61 | * @param value 配置值 62 | */ 63 | public void setValue(String value) { 64 | this.value = value; 65 | } 66 | 67 | /** 68 | * 获取配置分组 69 | * 70 | * @return group - 配置分组 71 | */ 72 | public Byte getGroup() { 73 | return group; 74 | } 75 | 76 | /** 77 | * 设置配置分组 78 | * 79 | * @param group 配置分组 80 | */ 81 | public void setGroup(Byte group) { 82 | this.group = group; 83 | } 84 | 85 | /** 86 | * 获取1需要登录后才能获取,0不需要登录即可获取 87 | * 88 | * @return need_auth - 1需要登录后才能获取,0不需要登录即可获取 89 | */ 90 | public Byte getNeedAuth() { 91 | return needAuth; 92 | } 93 | 94 | /** 95 | * 设置1需要登录后才能获取,0不需要登录即可获取 96 | * 97 | * @param needAuth 1需要登录后才能获取,0不需要登录即可获取 98 | */ 99 | public void setNeedAuth(Byte needAuth) { 100 | this.needAuth = needAuth; 101 | } 102 | } -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Account/changePwd.vue: -------------------------------------------------------------------------------- 1 | 18 | 21 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/position/edit.vue: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/system/menu/rule.vue: -------------------------------------------------------------------------------- 1 | 39 | 46 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/model/SysAdminPost.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.model; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Table; 5 | 6 | import cloud.simple.service.base.BaseEntity; 7 | 8 | @Table(name = "`sys_admin_post`") 9 | public class SysAdminPost extends BaseEntity { 10 | private static final long serialVersionUID = -3845160579870153375L; 11 | 12 | /** 13 | * 岗位名称 14 | */ 15 | @Column(name = "`name`") 16 | private String name; 17 | 18 | /** 19 | * 岗位备注 20 | */ 21 | @Column(name = "`remark`") 22 | private String remark; 23 | 24 | /** 25 | * 数据创建时间 26 | */ 27 | @Column(name = "`create_time`") 28 | private Integer createTime; 29 | 30 | /** 31 | * 状态1启用,0禁用 32 | */ 33 | @Column(name = "`status`") 34 | private Byte status; 35 | 36 | 37 | /** 38 | * 获取岗位名称 39 | * 40 | * @return name - 岗位名称 41 | */ 42 | public String getName() { 43 | return name; 44 | } 45 | 46 | /** 47 | * 设置岗位名称 48 | * 49 | * @param name 岗位名称 50 | */ 51 | public void setName(String name) { 52 | this.name = name; 53 | } 54 | 55 | /** 56 | * 获取岗位备注 57 | * 58 | * @return remark - 岗位备注 59 | */ 60 | public String getRemark() { 61 | return remark; 62 | } 63 | 64 | /** 65 | * 设置岗位备注 66 | * 67 | * @param remark 岗位备注 68 | */ 69 | public void setRemark(String remark) { 70 | this.remark = remark; 71 | } 72 | 73 | /** 74 | * 获取数据创建时间 75 | * 76 | * @return create_time - 数据创建时间 77 | */ 78 | public Integer getCreateTime() { 79 | return createTime; 80 | } 81 | 82 | /** 83 | * 设置数据创建时间 84 | * 85 | * @param createTime 数据创建时间 86 | */ 87 | public void setCreateTime(Integer createTime) { 88 | this.createTime = createTime; 89 | } 90 | 91 | /** 92 | * 获取状态1启用,0禁用 93 | * 94 | * @return status - 状态1启用,0禁用 95 | */ 96 | public Byte getStatus() { 97 | return status; 98 | } 99 | 100 | /** 101 | * 设置状态1启用,0禁用 102 | * 103 | * @param status 状态1启用,0禁用 104 | */ 105 | public void setStatus(Byte status) { 106 | this.status = status; 107 | } 108 | } -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/domain/SysAdminUserService.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.domain; 2 | 3 | import org.apache.commons.codec.digest.DigestUtils; 4 | import org.apache.commons.lang3.StringUtils; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.github.pagehelper.PageInfo; 9 | 10 | import cloud.simple.service.base.BaseServiceImpl; 11 | import cloud.simple.service.contants.Constant; 12 | import cloud.simple.service.dao.SysAdminUserDao; 13 | import cloud.simple.service.model.SysAdminUser; 14 | import cloud.simple.service.util.EncryptUtil; 15 | import cloud.simple.service.util.FastJsonUtils; 16 | import tk.mybatis.mapper.common.Mapper; 17 | @Service 18 | public class SysAdminUserService extends BaseServiceImpl{ 19 | @Autowired 20 | private SysAdminUserDao sysAdminUserDao; 21 | 22 | @Override 23 | public Mapper getMapper() { 24 | return sysAdminUserDao; 25 | } 26 | 27 | /** 28 | * 修改密码 29 | * @param currentUser 当前登录的用户信息 30 | * @param old_pwd 31 | * @param new_pwd 32 | * @return 修改失败返回错误信息,修改成功返回authKey信息。 33 | */ 34 | public String setInfo(SysAdminUser currentUser, String old_pwd, String new_pwd) { 35 | if (currentUser == null){ 36 | return FastJsonUtils.resultError(-400, "请先登录", null); 37 | } 38 | 39 | if (StringUtils.isNotBlank(old_pwd)) { 40 | return FastJsonUtils.resultError(-400, "旧密码必填", null); 41 | } 42 | 43 | if(StringUtils.isNotBlank(new_pwd)) { 44 | return FastJsonUtils.resultError(-400, "新密码必填", null); 45 | } 46 | 47 | if (old_pwd.equals(new_pwd)) { 48 | return FastJsonUtils.resultError(-400, "新旧密码不能一样", null); 49 | } 50 | 51 | if (!currentUser.getPassword().equals(DigestUtils.md5Hex(old_pwd))) { 52 | return FastJsonUtils.resultError(-400, "原密码错误", null); 53 | } 54 | 55 | if (!currentUser.getPassword().equals(DigestUtils.md5Hex(old_pwd))) { 56 | return FastJsonUtils.resultError(-400, "原密码错误", null); 57 | } 58 | SysAdminUser record = new SysAdminUser(); 59 | record.setId(currentUser.getId()); 60 | String md5NewPwd = DigestUtils.md5Hex(new_pwd); 61 | record.setPassword(md5NewPwd); 62 | sysAdminUserDao.updateByPrimaryKeySelective(record); 63 | String authKey = EncryptUtil.encryptBase64(currentUser.getUsername()+"|"+md5NewPwd, Constant.SECRET_KEY); 64 | //@TODO 更新缓存中auth_key 65 | return FastJsonUtils.resultError(200, "修改成功", authKey); 66 | } 67 | 68 | public PageInfo getDataList(SysAdminUser record) { 69 | return super.selectPage(record.getPage(), record.getRows(), record); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/base/BaseEntity.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.base; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.Transient; 11 | /** 12 | * 实体基类 13 | * @author leo.aqing 14 | * 15 | */ 16 | @Entity 17 | public class BaseEntity /* extends JSONObject*/ implements Serializable { 18 | 19 | private static final long serialVersionUID = 1L; 20 | 21 | @Id 22 | @Column(name = "Id") 23 | @GeneratedValue(strategy = GenerationType.IDENTITY) 24 | private Integer id; 25 | 26 | @Transient 27 | private Integer page = 1; 28 | 29 | @Transient 30 | private Integer rows = 10; 31 | 32 | /*@Column(name="enable_") 33 | private Integer enable; 34 | @Column(name="remark_") 35 | private String remark; 36 | private Long createBy; 37 | private Date createTime; 38 | private Long updateBy; 39 | private Date updateTime;*/ 40 | 41 | 42 | /** 43 | * @return the id 44 | */ 45 | public Integer getId() { 46 | return id; 47 | } 48 | 49 | /** 50 | * @param id 51 | * the id to set 52 | */ 53 | public void setId(Integer id) { 54 | this.id = id; 55 | } 56 | /** 57 | public Integer getEnable() { 58 | return enable; 59 | } 60 | 61 | public void setEnable(Integer enable) { 62 | this.enable = enable; 63 | } 64 | 65 | public String getRemark() { 66 | return remark; 67 | } 68 | 69 | public void setRemark(String remark) { 70 | this.remark = remark; 71 | } 72 | 73 | public Long getCreateBy() { 74 | return createBy; 75 | } 76 | 77 | public void setCreateBy(Long createBy) { 78 | this.createBy = createBy; 79 | } 80 | 81 | public Date getCreateTime() { 82 | return createTime; 83 | } 84 | 85 | public void setCreateTime(Date createTime) { 86 | this.createTime = createTime; 87 | } 88 | 89 | public Long getUpdateBy() { 90 | return updateBy; 91 | } 92 | 93 | public void setUpdateBy(Long updateBy) { 94 | this.updateBy = updateBy; 95 | } 96 | 97 | public Date getUpdateTime() { 98 | return updateTime; 99 | } 100 | 101 | public void setUpdateTime(Date updateTime) { 102 | this.updateTime = updateTime; 103 | }*/ 104 | 105 | public Integer getPage() { 106 | return page; 107 | } 108 | 109 | public void setPage(Integer page) { 110 | this.page = page; 111 | } 112 | 113 | public Integer getRows() { 114 | return rows; 115 | } 116 | 117 | public void setRows(Integer rows) { 118 | this.rows = rows; 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/interceptor/LoginInterceptor.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.interceptor; 2 | 3 | import java.io.PrintWriter; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | import javax.servlet.http.HttpSession; 8 | 9 | import org.apache.commons.lang3.StringUtils; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Component; 12 | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; 13 | 14 | import cloud.simple.service.contants.Constant; 15 | import cloud.simple.service.domain.SysAdminUserService; 16 | import cloud.simple.service.model.SysAdminUser; 17 | import cloud.simple.service.util.EncryptUtil; 18 | import cloud.simple.service.util.FastJsonUtils; 19 | @Component 20 | public class LoginInterceptor extends HandlerInterceptorAdapter { 21 | 22 | @Autowired 23 | private SysAdminUserService sysAdminUserService; 24 | 25 | 26 | 27 | @Override 28 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) 29 | throws Exception { 30 | System.out.println("请求url:" + request.getRequestURI()); 31 | System.out.println("header auth key:" + request.getHeader(Constant.AUTH_KEY)); 32 | String authKey = request.getHeader(Constant.AUTH_KEY); 33 | String sessionId = request.getHeader(Constant.SESSION_ID); 34 | HttpSession session = request.getSession(); 35 | // 校验sessionid和authKey 36 | if(StringUtils.isEmpty(authKey) || StringUtils.isEmpty(sessionId)) { 37 | response.setContentType("application/json;charset=UTF-8"); 38 | PrintWriter writer = response.getWriter(); 39 | writer.write(FastJsonUtils.resultError(-100, "authKey或sessionId不能为空!", null)); 40 | writer.flush(); 41 | return false; 42 | } 43 | 44 | //检查账号有效性 45 | SysAdminUser sessionAdminUser = (SysAdminUser)session.getAttribute(Constant.LOGIN_ADMIN_USER); 46 | if(sessionAdminUser == null) { 47 | String decryptAuthKey = EncryptUtil.decryptBase64(authKey, Constant.SECRET_KEY); 48 | String[] auths = decryptAuthKey.split("\\|"); 49 | String username = auths[0]; 50 | String password = auths[1]; 51 | SysAdminUser record = new SysAdminUser(); 52 | record.setUsername(username); 53 | record.setPassword(password); 54 | sessionAdminUser = sysAdminUserService.selectOne(record); 55 | //设置登录用户id 56 | session.setAttribute(Constant.LOGIN_ADMIN_USER, sessionAdminUser); 57 | } 58 | 59 | if(sessionAdminUser == null || sessionAdminUser.getStatus().equals(0)) { 60 | response.setContentType("application/json;charset=UTF-8"); 61 | PrintWriter writer = response.getWriter(); 62 | writer.write(FastJsonUtils.resultError(-101, "账号已被删除或禁用", null)); 63 | writer.flush(); 64 | return false; 65 | } 66 | 67 | return true; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/util/TreeBuilder.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import cloud.simple.service.dto.TreeNode; 7 | 8 | public class TreeBuilder { 9 | 10 | /** 11 | * 使用递归方法建树 12 | * @param treeNodes 13 | * @return 14 | */ 15 | public static List buildByRecursive(List treeNodes) { 16 | List trees = new ArrayList(); 17 | for (TreeNode treeNode : treeNodes) { 18 | System.err.println(treeNode); 19 | if ("0".equals(treeNode.getParentId())) { 20 | trees.add(findChildren(treeNode,treeNodes, 0)); 21 | } 22 | } 23 | return trees; 24 | } 25 | 26 | /** 27 | * 递归查找子节点 28 | * @param treeNodes 29 | * @return 30 | */ 31 | public static TreeNode findChildren(TreeNode treeNode,List treeNodes, int root) { 32 | treeNode.put("selected", false); 33 | treeNode.put("level", root); 34 | for (TreeNode it : treeNodes) { 35 | if(treeNode.getId().equals(it.getParentId())) { 36 | if (treeNode.getChildren() == null) { 37 | treeNode.setChildren(new ArrayList()); 38 | } 39 | treeNode.getChildren().add(findChildren(it,treeNodes, root+1)); 40 | } 41 | } 42 | return treeNode; 43 | } 44 | 45 | /* public static void main(String[] args) { 46 | TreeNode treeNode1 = new TreeNode("1","广州","0"); 47 | TreeNode treeNode2 = new TreeNode("2","深圳","0"); 48 | 49 | TreeNode treeNode3 = new TreeNode("3","天河区","1"); 50 | TreeNode treeNode4 = new TreeNode("4","越秀区","2"); 51 | TreeNode treeNode5 = new TreeNode("5","黄埔区",treeNode1); 52 | TreeNode treeNode6 = new TreeNode("6","石牌",treeNode3); 53 | TreeNode treeNode7 = new TreeNode("7","百脑汇",treeNode6); 54 | 55 | 56 | TreeNode treeNode8 = new TreeNode("8","南山区",treeNode2); 57 | TreeNode treeNode9 = new TreeNode("9","宝安区",treeNode2); 58 | TreeNode treeNode10 = new TreeNode("10","科技园",treeNode8); 59 | 60 | 61 | List list = new ArrayList(); 62 | 63 | list.add(treeNode1); 64 | list.add(treeNode2); 65 | list.add(treeNode3); 66 | list.add(treeNode4); 67 | list.add(treeNode5); 68 | list.add(treeNode6); 69 | list.add(treeNode7); 70 | list.add(treeNode8); 71 | list.add(treeNode9); 72 | list.add(treeNode10); 73 | 74 | List trees_ = TreeBuilder.buildByRecursive(list); 75 | 76 | System.out.println(trees_); 77 | }*/ 78 | } 79 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.framework 6 | cloud-vue-parent 7 | 1.0.0 8 | pom 9 | 10 | framework-clound-parent 11 | http://maven.apache.org 12 | 13 | 14 | UTF-8 15 | 0.3.258 16 | 1.4.5 17 | 1.0.18 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-parent 23 | 1.4.5.RELEASE 24 | 25 | 26 | 27 | 28 | org.springframework.cloud 29 | spring-cloud-dependencies 30 | Camden.SR6 31 | pom 32 | import 33 | 34 | 35 | 36 | 37 | cloud-config-server 38 | cloud-eureka-server 39 | cloud-simple-service 40 | cloud-zipkin-ui 41 | 42 | 43 | 44 | 45 | aliyun-maven 46 | aliyun maven 47 | http://maven.aliyun.com/nexus/content/groups/public/ 48 | 49 | false 50 | 51 | 52 | 53 | spring-releases 54 | Spring Releases 55 | https://repo.spring.io/libs-release-local 56 | 57 | false 58 | 59 | 60 | 61 | spring-milestones 62 | Spring Milestones 63 | http://repo.spring.io/libs-milestone-local 64 | 65 | false 66 | 67 | 68 | 69 | 70 | 71 | public 72 | Public Repositories 73 | http://maven.aliyun.com/nexus/content/groups/public/ 74 | 75 | 76 | 77 | 78 | 79 | 80 | org.springframework.boot 81 | spring-boot-maven-plugin 82 | 83 | 84 | compile 85 | 86 | 87 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/structures/edit.vue: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/base/BaseService.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.base; 2 | 3 | import java.util.List; 4 | 5 | import com.github.pagehelper.PageInfo; 6 | 7 | /** 8 | * 服务基类 9 | * @author leo.aqing 10 | */ 11 | public interface BaseService { 12 | 13 | /** 14 | * 根据实体类不为null的字段进行查询,条件全部使用=号and条件 15 | * @param record 对象 对象 16 | * @return List 17 | */ 18 | List select(T record); 19 | 20 | /** 21 | * 根据实体类不为null的字段查询总数,条件全部使用=号and条件 22 | * @param record 对象 对象 23 | * @return List 24 | */ 25 | int selectCount(T record); 26 | 27 | /** 28 | * 根据主键进行查询,必须保证结果唯一 29 | * 单个字段做主键时,可以直接写主键的值 30 | * 联合主键时,key可以是实体类,也可以是Map 31 | * @param key 主键 32 | * @return T 33 | */ 34 | T selectByPrimaryKey(Object key); 35 | 36 | /** 37 | * 插入一条数据 38 | * 支持Oracle序列,UUID,类似Mysql的INDENTITY自动增长(自动回写) 39 | * 优先使用传入的参数值,参数值空时,才会使用序列、UUID,自动增长 40 | * @param record 对象 41 | * @return int 受影响的行 42 | */ 43 | int insert(T record); 44 | 45 | /** 46 | * 插入一条数据,只插入不为null的字段,不会影响有默认值的字段 47 | *支持Oracle序列,UUID,类似Mysql的INDENTITY自动增长(自动回写) 48 | *优先使用传入的参数值,参数值空时,才会使用序列、UUID,自动增长 49 | * @param record 对象 50 | * @return int 受影响的行 51 | */ 52 | int insertSelective(T record); 53 | 54 | /** 55 | * 根据实体类不为null的字段进行查询,条件全部使用=号and条件 56 | * @param record 对象 57 | * @return int 受影响的行 58 | */ 59 | int delete(T record); 60 | 61 | /** 62 | * 通过主键进行删除,这里最多只会删除一条数据 63 | *单个字段做主键时,可以直接写主键的值 64 | *联合主键时,key可以是实体类,也可以是Map 65 | * @param key 主键 66 | * @return int 受影响的行 67 | */ 68 | int deleteByPrimaryKey(Object key); 69 | 70 | /** 71 | *根据主键进行更新,这里最多只会更新一条数据 72 | *参数为实体类 73 | * @param record 对象 74 | * @return int 受影响的行 75 | */ 76 | int updateByPrimaryKey(T record); 77 | 78 | /** 79 | *根据主键进行更新 80 | *只会更新不是null的数据 81 | * @param record 对象 82 | * @return int 受影响的行 83 | */ 84 | int updateByPrimaryKeySelective(T record); 85 | 86 | 87 | /** 88 | * 保存或者更新,根据传入id主键是不是null来确认 89 | * @param record 对象 90 | * @return int 影响行数 91 | */ 92 | int save(T record); 93 | 94 | /** 95 | *(单表分页可排序) 96 | * @param pageNum 当前页 97 | * @param pageSize 页码 98 | * @param record 对象 99 | * @return PageInfo 分页对象 100 | */ 101 | PageInfo selectPage(int pageNum,int pageSize,T record); 102 | 103 | 104 | /** 105 | * (单表分页可排序) 106 | * @param pageNum 当前页 107 | * @param pageSize 页码 108 | * @param record 对象 109 | * @param orderSqlStr (如:id desc) 110 | * @return PageInfo 分页对象 111 | */ 112 | PageInfo selectPage(int pageNum, int pageSize, T record,String orderSqlStr); 113 | 114 | /** 115 | * 根据实体类不为null的字段进行查询,条件全部使用=号and条件 116 | * @param record 117 | * @return 118 | */ 119 | T selectOne(T record); 120 | } 121 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/util/TreeUtil.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.apache.commons.collections.CollectionUtils; 7 | 8 | import cloud.simple.service.dto.TreeNode; 9 | import cloud.simple.service.model.SysAdminMenu; 10 | import cloud.simple.service.model.SysAdminRule; 11 | 12 | /** 13 | * 树工具类 14 | * @author leo 15 | * 16 | */ 17 | public class TreeUtil { 18 | /** 19 | * 将数据集转换成Tree(真正的Tree结构) 20 | * @param array $list 要转换的数据集 21 | * @param string $root 返回的根节点ID 22 | * @return List 23 | */ 24 | public static List listMenuToTree(List list,Integer rootId) { 25 | //创建tree 26 | List tree = new ArrayList(); 27 | if (CollectionUtils.isNotEmpty(list)) { 28 | for (SysAdminMenu menu : list) { 29 | Integer pid = menu.getPid(); 30 | if(pid == null || pid.equals(rootId)) { 31 | TreeNode treeNode = new TreeNode(menu.getId().toString(), menu.getTitle(),"0"); 32 | treeNode.put("url", menu.getUrl()); 33 | treeNode.put("menu_type", menu.getMenuType()); 34 | treeNode.put("sort", menu.getSort()); 35 | treeNode.put("status", menu.getStatus()); 36 | treeNode.put("rule_id", menu.getRuleId()); 37 | treeNode.put("module", menu.getModule()); 38 | treeNode.put("module", menu.getModule()); 39 | treeNode.put("menu", menu.getMenu()); 40 | tree.add(treeNode); 41 | } else { 42 | TreeNode treeNode = new TreeNode(menu.getId().toString(), menu.getTitle(),pid.toString()); 43 | treeNode.put("url", menu.getUrl()); 44 | treeNode.put("menu_type", menu.getMenuType()); 45 | treeNode.put("sort", menu.getSort()); 46 | treeNode.put("status", menu.getStatus()); 47 | treeNode.put("rule_id", menu.getRuleId()); 48 | treeNode.put("module", menu.getModule()); 49 | treeNode.put("module", menu.getModule()); 50 | treeNode.put("menu", menu.getMenu()); 51 | tree.add(treeNode); 52 | } 53 | } 54 | } 55 | return TreeBuilder.buildByRecursive(tree); 56 | } 57 | 58 | /** 59 | * 将数据集转换成Tree(真正的Tree结构) 60 | * @param array $list 要转换的数据集 61 | * @param string $root 返回的根节点ID 62 | * @return List 63 | */ 64 | public static List listRuleToTree(List list,Integer rootId) { 65 | //创建tree 66 | List tree = new ArrayList(); 67 | if (CollectionUtils.isNotEmpty(list)) { 68 | for (SysAdminRule rule : list) { 69 | Integer pid = rule.getPid(); 70 | if(pid == null || pid.equals(rootId)) { 71 | TreeNode treeNode = new TreeNode(rule.getId().toString(), rule.getTitle(),"0"); 72 | tree.add(treeNode); 73 | } else { 74 | TreeNode treeNode = new TreeNode(rule.getId().toString(), rule.getTitle(),pid.toString()); 75 | tree.add(treeNode); 76 | } 77 | } 78 | } 79 | return TreeBuilder.buildByRecursive(tree); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Common/btn-group.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/system/rule/add.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var webpack = require('webpack') 5 | var projectRoot = path.resolve(__dirname, '../') 6 | 7 | var env = process.env.NODE_ENV 8 | // check env & config/index.js to decide weither to enable CSS Sourcemaps for the 9 | // various preprocessor loaders added to vue-loader at the end of this file 10 | var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap) 11 | var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap) 12 | var useCssSourceMap = cssSourceMapDev || cssSourceMapProd 13 | 14 | // define the different HOST between development and production environment 15 | var DEV_HOST = JSON.stringify('http://localhost:8080/api/') 16 | var PUB_HOST = JSON.stringify('http://localhost:8080/api/') 17 | 18 | module.exports = { 19 | entry: { 20 | app: './src/main.js' 21 | }, 22 | output: { 23 | path: config.build.assetsRoot, 24 | publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath, 25 | filename: '[name].js' 26 | }, 27 | eslint: { 28 | configFile: './.eslintrc.json' 29 | }, 30 | plugins: [ 31 | new webpack.DefinePlugin({ 32 | HOST: process.env.NODE_ENV === 'production' ? PUB_HOST : DEV_HOST 33 | }) 34 | ], 35 | resolve: { 36 | extensions: ['', '.js', '.vue'], 37 | fallback: [path.join(__dirname, '../node_modules')], 38 | alias: { 39 | 'vue$': 'vue/dist/vue', 40 | 'src': path.resolve(__dirname, '../src'), 41 | 'assets': path.resolve(__dirname, '../src/assets'), 42 | 'components': path.resolve(__dirname, '../src/components') 43 | } 44 | }, 45 | resolveLoader: { 46 | fallback: [path.join(__dirname, '../node_modules')] 47 | }, 48 | module: { 49 | preLoaders: [ 50 | { 51 | test: /\.js$/, 52 | exclude: /node_modules/, 53 | loader: 'eslint' 54 | }, 55 | { 56 | test: /\.vue$/, 57 | exclude: /node_modules/, 58 | loader: 'eslint' 59 | } 60 | ], 61 | loaders: [ 62 | { 63 | test: /\.vue$/, 64 | loader: 'vue' 65 | }, 66 | { 67 | test: /\.js$/, 68 | loader: 'babel', 69 | include: projectRoot, 70 | exclude: /node_modules/, 71 | query: { 72 | presets: ['es2015', 'stage-3'] 73 | } 74 | }, 75 | { 76 | test: /\.json$/, 77 | loader: 'json' 78 | }, 79 | { 80 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 81 | loader: 'url', 82 | query: { 83 | limit: 10000, 84 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 85 | } 86 | }, 87 | { 88 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 89 | loader: 'url', 90 | query: { 91 | limit: 10000, 92 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 93 | } 94 | } 95 | ] 96 | }, 97 | vue: { 98 | loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }), 99 | postcss: [ 100 | require('autoprefixer')({ 101 | browsers: ['last 2 versions'] 102 | }) 103 | ] 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/model/SysAdminRule.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.model; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Table; 7 | import javax.persistence.Transient; 8 | 9 | import cloud.simple.service.base.BaseEntity; 10 | 11 | @Table(name = "`sys_admin_rule`") 12 | public class SysAdminRule extends BaseEntity{ 13 | private static final long serialVersionUID = 3783338463831001070L; 14 | 15 | /** 16 | * 名称 17 | */ 18 | @Column(name = "`title`") 19 | private String title; 20 | 21 | /** 22 | * 定义 23 | */ 24 | @Column(name = "`name`") 25 | private String name; 26 | 27 | /** 28 | * 级别。1模块,2控制器,3操作 29 | */ 30 | @Column(name = "`level`") 31 | private Byte level; 32 | 33 | /** 34 | * 父id,默认0 35 | */ 36 | @Column(name = "`pid`") 37 | private Integer pid; 38 | 39 | /** 40 | * 状态,1启用,0禁用 41 | */ 42 | @Column(name = "`status`") 43 | private Byte status; 44 | 45 | /** 46 | * 子权限 47 | */ 48 | @Transient 49 | private List child; 50 | 51 | 52 | /** 53 | * 获取名称 54 | * 55 | * @return title - 名称 56 | */ 57 | public String getTitle() { 58 | return title; 59 | } 60 | 61 | /** 62 | * 设置名称 63 | * 64 | * @param title 名称 65 | */ 66 | public void setTitle(String title) { 67 | this.title = title; 68 | } 69 | 70 | /** 71 | * 获取定义 72 | * 73 | * @return name - 定义 74 | */ 75 | public String getName() { 76 | return name; 77 | } 78 | 79 | /** 80 | * 设置定义 81 | * 82 | * @param name 定义 83 | */ 84 | public void setName(String name) { 85 | this.name = name; 86 | } 87 | 88 | /** 89 | * 获取级别。1模块,2控制器,3操作 90 | * 91 | * @return level - 级别。1模块,2控制器,3操作 92 | */ 93 | public Byte getLevel() { 94 | return level; 95 | } 96 | 97 | /** 98 | * 设置级别。1模块,2控制器,3操作 99 | * 100 | * @param level 级别。1模块,2控制器,3操作 101 | */ 102 | public void setLevel(Byte level) { 103 | this.level = level; 104 | } 105 | 106 | /** 107 | * 获取父id,默认0 108 | * 109 | * @return pid - 父id,默认0 110 | */ 111 | public Integer getPid() { 112 | return pid; 113 | } 114 | 115 | /** 116 | * 设置父id,默认0 117 | * 118 | * @param pid 父id,默认0 119 | */ 120 | public void setPid(Integer pid) { 121 | this.pid = pid; 122 | } 123 | 124 | /** 125 | * 获取状态,1启用,0禁用 126 | * 127 | * @return status - 状态,1启用,0禁用 128 | */ 129 | public Byte getStatus() { 130 | return status; 131 | } 132 | 133 | /** 134 | * 设置状态,1启用,0禁用 135 | * 136 | * @param status 状态,1启用,0禁用 137 | */ 138 | public void setStatus(Byte status) { 139 | this.status = status; 140 | } 141 | 142 | public List getChild() { 143 | return child; 144 | } 145 | 146 | public void setChild(List child) { 147 | this.child = child; 148 | } 149 | 150 | 151 | } -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/system/menu/list.vue: -------------------------------------------------------------------------------- 1 | 65 | 66 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/position/list.vue: -------------------------------------------------------------------------------- 1 | 61 | 62 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var webpack = require('webpack') 5 | var merge = require('webpack-merge') 6 | var baseWebpackConfig = require('./webpack.base.conf') 7 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 8 | var HtmlWebpackPlugin = require('html-webpack-plugin') 9 | var env = config.build.env 10 | 11 | var webpackConfig = merge(baseWebpackConfig, { 12 | module: { 13 | loaders: utils.styleLoaders({ sourceMap: config.build.productionSourceMap, extract: true }) 14 | }, 15 | devtool: config.build.productionSourceMap ? '#source-map' : false, 16 | output: { 17 | path: config.build.assetsRoot, 18 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 19 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 20 | }, 21 | vue: { 22 | loaders: utils.cssLoaders({ 23 | sourceMap: config.build.productionSourceMap, 24 | extract: true 25 | }) 26 | }, 27 | plugins: [ 28 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 29 | new webpack.DefinePlugin({ 30 | 'process.env': env 31 | }), 32 | new webpack.optimize.UglifyJsPlugin({ 33 | compress: { 34 | warnings: false 35 | } 36 | }), 37 | new webpack.optimize.OccurenceOrderPlugin(), 38 | // extract css into its own file 39 | new ExtractTextPlugin(utils.assetsPath('css/[name].[contenthash].css')), 40 | // generate dist index.html with correct asset hash for caching. 41 | // you can customize output by editing /index.html 42 | // see https://github.com/ampedandwired/html-webpack-plugin 43 | new HtmlWebpackPlugin({ 44 | filename: config.build.index, 45 | template: 'index.html', 46 | inject: true, 47 | minify: { 48 | removeComments: true, 49 | collapseWhitespace: true, 50 | removeAttributeQuotes: true 51 | // more options: 52 | // https://github.com/kangax/html-minifier#options-quick-reference 53 | }, 54 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 55 | chunksSortMode: 'dependency' 56 | }), 57 | // split vendor js into its own file 58 | new webpack.optimize.CommonsChunkPlugin({ 59 | name: 'vendor', 60 | minChunks: function (module, count) { 61 | // any required modules inside node_modules are extracted to vendor 62 | return ( 63 | module.resource && 64 | /\.js$/.test(module.resource) && 65 | module.resource.indexOf( 66 | path.join(__dirname, '../node_modules') 67 | ) === 0 68 | ) 69 | } 70 | }), 71 | // extract webpack runtime and module manifest to its own file in order to 72 | // prevent vendor hash from being updated whenever app bundle is updated 73 | new webpack.optimize.CommonsChunkPlugin({ 74 | name: 'manifest', 75 | chunks: ['vendor'] 76 | }) 77 | ] 78 | }) 79 | 80 | if (config.build.productionGzip) { 81 | var CompressionWebpackPlugin = require('compression-webpack-plugin') 82 | 83 | webpackConfig.plugins.push( 84 | new CompressionWebpackPlugin({ 85 | asset: '[path].gz[query]', 86 | algorithm: 'gzip', 87 | test: new RegExp( 88 | '\\.(' + 89 | config.build.productionGzipExtensions.join('|') + 90 | ')$' 91 | ), 92 | threshold: 10240, 93 | minRatio: 0.8 94 | }) 95 | ) 96 | } 97 | 98 | module.exports = webpackConfig 99 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/groups/list.vue: -------------------------------------------------------------------------------- 1 | 61 | 62 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/structures/list.vue: -------------------------------------------------------------------------------- 1 | 61 | 62 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-zipkin-ui/src/main/resources/mysql_init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS `zipkin` DEFAULT CHARACTER SET utf8 ; 2 | USE zipkin; 3 | CREATE TABLE IF NOT EXISTS zipkin_spans ( 4 | `trace_id_high` BIGINT NOT NULL DEFAULT 0 COMMENT 'If non zero, this means the trace uses 128 bit traceIds instead of 64 bit', 5 | `trace_id` BIGINT NOT NULL, 6 | `id` BIGINT NOT NULL, 7 | `name` VARCHAR(255) NOT NULL, 8 | `parent_id` BIGINT, 9 | `debug` BIT(1), 10 | `start_ts` BIGINT COMMENT 'Span.timestamp(): epoch micros used for endTs query and to implement TTL', 11 | `duration` BIGINT COMMENT 'Span.duration(): micros used for minDuration and maxDuration query' 12 | ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED CHARACTER SET=utf8 COLLATE utf8_general_ci; 13 | 14 | ALTER TABLE zipkin_spans ADD UNIQUE KEY(`trace_id_high`, `trace_id`, `id`) COMMENT 'ignore insert on duplicate'; 15 | ALTER TABLE zipkin_spans ADD INDEX(`trace_id_high`, `trace_id`, `id`) COMMENT 'for joining with zipkin_annotations'; 16 | ALTER TABLE zipkin_spans ADD INDEX(`trace_id_high`, `trace_id`) COMMENT 'for getTracesByIds'; 17 | ALTER TABLE zipkin_spans ADD INDEX(`name`) COMMENT 'for getTraces and getSpanNames'; 18 | ALTER TABLE zipkin_spans ADD INDEX(`start_ts`) COMMENT 'for getTraces ordering and range'; 19 | 20 | CREATE TABLE IF NOT EXISTS zipkin_annotations ( 21 | `trace_id_high` BIGINT NOT NULL DEFAULT 0 COMMENT 'If non zero, this means the trace uses 128 bit traceIds instead of 64 bit', 22 | `trace_id` BIGINT NOT NULL COMMENT 'coincides with zipkin_spans.trace_id', 23 | `span_id` BIGINT NOT NULL COMMENT 'coincides with zipkin_spans.id', 24 | `a_key` VARCHAR(255) NOT NULL COMMENT 'BinaryAnnotation.key or Annotation.value if type == -1', 25 | `a_value` BLOB COMMENT 'BinaryAnnotation.value(), which must be smaller than 64KB', 26 | `a_type` INT NOT NULL COMMENT 'BinaryAnnotation.type() or -1 if Annotation', 27 | `a_timestamp` BIGINT COMMENT 'Used to implement TTL; Annotation.timestamp or zipkin_spans.timestamp', 28 | `endpoint_ipv4` INT COMMENT 'Null when Binary/Annotation.endpoint is null', 29 | `endpoint_ipv6` BINARY(16) COMMENT 'Null when Binary/Annotation.endpoint is null, or no IPv6 address', 30 | `endpoint_port` SMALLINT COMMENT 'Null when Binary/Annotation.endpoint is null', 31 | `endpoint_service_name` VARCHAR(255) COMMENT 'Null when Binary/Annotation.endpoint is null' 32 | ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED CHARACTER SET=utf8 COLLATE utf8_general_ci; 33 | 34 | ALTER TABLE zipkin_annotations ADD UNIQUE KEY(`trace_id_high`, `trace_id`, `span_id`, `a_key`, `a_timestamp`) COMMENT 'Ignore insert on duplicate'; 35 | ALTER TABLE zipkin_annotations ADD INDEX(`trace_id_high`, `trace_id`, `span_id`) COMMENT 'for joining with zipkin_spans'; 36 | ALTER TABLE zipkin_annotations ADD INDEX(`trace_id_high`, `trace_id`) COMMENT 'for getTraces/ByIds'; 37 | ALTER TABLE zipkin_annotations ADD INDEX(`endpoint_service_name`) COMMENT 'for getTraces and getServiceNames'; 38 | ALTER TABLE zipkin_annotations ADD INDEX(`a_type`) COMMENT 'for getTraces'; 39 | ALTER TABLE zipkin_annotations ADD INDEX(`a_key`) COMMENT 'for getTraces'; 40 | ALTER TABLE zipkin_annotations ADD INDEX(`trace_id`, `span_id`, `a_key`) COMMENT 'for dependencies job'; 41 | 42 | CREATE TABLE IF NOT EXISTS zipkin_dependencies ( 43 | `day` DATE NOT NULL, 44 | `parent` VARCHAR(255) NOT NULL, 45 | `child` VARCHAR(255) NOT NULL, 46 | `call_count` BIGINT 47 | ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED CHARACTER SET=utf8 COLLATE utf8_general_ci; 48 | 49 | ALTER TABLE zipkin_dependencies ADD UNIQUE KEY(`day`, `parent`, `child`); -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/system/rule/list.vue: -------------------------------------------------------------------------------- 1 | 66 | 67 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/system/rule/edit.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/util/Category.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.util; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.apache.commons.collections.CollectionUtils; 7 | import org.apache.commons.lang3.StringUtils; 8 | 9 | import com.google.common.collect.Lists; 10 | 11 | import cloud.simple.service.contants.Constant; 12 | /** 13 | * 分类管理 14 | */ 15 | public class Category { 16 | //原始的分类数据 17 | private List> rawList = Lists.newArrayList(); 18 | //格式化后的分类 19 | private List> formatList = Lists.newArrayList(); 20 | //字段映射 21 | private Map fields = null; 22 | 23 | /** 24 | * @param fields 25 | * cid 当前分类id 26 | * fid 当前分类的父id 27 | * @param rawList 28 | */ 29 | public Category(Map fields, List> rawList) { 30 | this.fields = fields; 31 | this.rawList = rawList; 32 | 33 | fields.put("cid", fields.get("cid") != null ? fields.get("cid") : "cid"); 34 | fields.put("fid", fields.get("fid") != null ? fields.get("fid") : "fid"); 35 | fields.put("name", fields.get("name") != null ? fields.get("name") : "name"); 36 | fields.put("fullname", fields.get("fullname") != null ? fields.get("fullname") : "fullname"); 37 | } 38 | 39 | public List> getRawList() { 40 | return rawList; 41 | } 42 | public void setRawList(List> rawList) { 43 | this.rawList = rawList; 44 | } 45 | public List> getFormatList() { 46 | return formatList; 47 | } 48 | public void setFormatList(List> formatList) { 49 | this.formatList = formatList; 50 | } 51 | 52 | 53 | /** 54 | * 返回指定的上级分类的所有同一级子分类 55 | * @param fid 查询的分类id 56 | * @return 57 | */ 58 | public List> getChild(Object fid) { 59 | List> results = Lists.newArrayList(); 60 | for (Map m : rawList) { 61 | if(fid.equals(m.get(fields.get("fid")))) 62 | results.add(m); 63 | } 64 | return results; 65 | } 66 | 67 | /** 68 | * 递归格式化分类前的字符 69 | * @param pid 分类id 70 | * @param space 空白 71 | * @param level 级别 72 | * @param p_name 父名称 73 | * @return 74 | */ 75 | private void _searchList( Object cid, String space, int level, Object pname){ 76 | List> childs = this.getChild(cid); 77 | //如果没有下级分类,结束递归 78 | if(CollectionUtils.isEmpty(childs)) { 79 | return; 80 | } 81 | int n = childs.size(); 82 | int m = 1; 83 | for (int i = 0; i < n; i++) { 84 | Map child = childs.get(i); 85 | String pre = ""; 86 | String pad = ""; 87 | if (n == m) { 88 | pre = Constant.ICON[2]; 89 | } else { 90 | pre = Constant.ICON[1]; 91 | pad = StringUtils.isBlank(space) ? Constant.ICON[0] : ""; 92 | } 93 | child.put("p_title", pname); 94 | child.put("else", child.get(fields.get("name"))); 95 | child.put(fields.get("fullname"), (!cid.equals(0)? space + pre : "") + child.get(fields.get("name"))); 96 | child.put("level", level); 97 | formatList.add(child); 98 | this._searchList(child.get(fields.get("cid")), space + pad + " ", level + 1, child.get("else")); 99 | m++; 100 | } 101 | } 102 | 103 | /** 104 | * 递归格式化分类 105 | * @param cid 起始分类 106 | * @return 107 | */ 108 | public List> getList(Object cid) { 109 | this._searchList(cid, "", 1, ""); 110 | return formatList; 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/util/BeanToMapUtil.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.util; 2 | 3 | import java.beans.BeanInfo; 4 | import java.beans.IntrospectionException; 5 | import java.beans.Introspector; 6 | import java.beans.PropertyDescriptor; 7 | import java.lang.reflect.InvocationTargetException; 8 | import java.lang.reflect.Method; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | 12 | 13 | public class BeanToMapUtil { 14 | /** 15 | * 将一个 Map 对象转化为一个 JavaBean 16 | * 17 | * @param type 18 | * 要转化的类型 19 | * @param map 20 | * 包含属性值的 map 21 | * @return 转化出来的 JavaBean 对象 22 | * @throws IntrospectionException 23 | * 如果分析类属性失败 24 | * @throws IllegalAccessException 25 | * 如果实例化 JavaBean 失败 26 | * @throws InstantiationException 27 | * 如果实例化 JavaBean 失败 28 | * @throws InvocationTargetException 29 | * 如果调用属性的 setter 方法失败 30 | */ 31 | public static Object convertMap(Class type, Map map) 32 | throws IntrospectionException, IllegalAccessException, 33 | InstantiationException, InvocationTargetException { 34 | BeanInfo beanInfo = Introspector.getBeanInfo(type); // 获取类属性 35 | Object obj = type.newInstance(); // 创建 JavaBean 对象 36 | 37 | // 给 JavaBean 对象的属性赋值 38 | PropertyDescriptor[] propertyDescriptors = beanInfo 39 | .getPropertyDescriptors(); 40 | for (int i = 0; i < propertyDescriptors.length; i++) { 41 | PropertyDescriptor descriptor = propertyDescriptors[i]; 42 | String propertyName = descriptor.getName(); 43 | 44 | if (map.containsKey(propertyName)) { 45 | // 下面一句可以 try 起来,这样当一个属性赋值失败的时候就不会影响其他属性赋值。 46 | Object value = map.get(propertyName); 47 | 48 | Object[] args = new Object[1]; 49 | args[0] = value; 50 | 51 | descriptor.getWriteMethod().invoke(obj, args); 52 | } 53 | } 54 | return obj; 55 | } 56 | 57 | /** 58 | * 将一个 JavaBean 对象转化为一个 Map 59 | * 60 | * @param bean 61 | * 要转化的JavaBean 对象 62 | * @return 转化出来的 Map 对象 63 | * @throws IntrospectionException 64 | * 如果分析类属性失败 65 | * @throws IllegalAccessException 66 | * 如果实例化 JavaBean 失败 67 | * @throws InvocationTargetException 68 | * 如果调用属性的 setter 方法失败 69 | */ 70 | public static Map convertBean(Object bean) { 71 | Class type = bean.getClass(); 72 | Map returnMap = new HashMap(); 73 | BeanInfo beanInfo; 74 | try { 75 | beanInfo = Introspector.getBeanInfo(type); 76 | PropertyDescriptor[] propertyDescriptors = beanInfo 77 | .getPropertyDescriptors(); 78 | for (int i = 0; i < propertyDescriptors.length; i++) { 79 | PropertyDescriptor descriptor = propertyDescriptors[i]; 80 | String propertyName = descriptor.getName(); 81 | if (!propertyName.equals("class")) { 82 | Method readMethod = descriptor.getReadMethod(); 83 | Object result = readMethod.invoke(bean, new Object[0]); 84 | if (result != null) { 85 | returnMap.put(propertyName, result); 86 | } else { 87 | returnMap.put(propertyName, ""); 88 | } 89 | } 90 | } 91 | } catch (Exception e) { 92 | e.printStackTrace(); 93 | } 94 | return returnMap; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/conf/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014-2016 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | package cloud.simple.service.conf; 26 | 27 | import org.springframework.beans.factory.annotation.Autowired; 28 | import org.springframework.beans.factory.annotation.Value; 29 | import org.springframework.context.annotation.Configuration; 30 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 31 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 32 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 33 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 34 | 35 | import cloud.simple.service.interceptor.LoginInterceptor; 36 | 37 | @Configuration 38 | public class WebMvcConfig extends WebMvcConfigurerAdapter { 39 | 40 | @Value("${spring.http.multipart.location}") 41 | private String multipartLocation; 42 | @Autowired 43 | private LoginInterceptor loginInterceptor; 44 | 45 | @Override 46 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 47 | registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); 48 | registry.addResourceHandler("/upload/**").addResourceLocations("file:"+multipartLocation+"/upload/"); 49 | registry.addResourceHandler("/resoures/**").addResourceLocations("classpath:/resoures/"); 50 | } 51 | 52 | 53 | @Override 54 | public void addCorsMappings(CorsRegistry registry) { 55 | registry.addMapping("/**") 56 | .allowedOrigins("*") 57 | .allowCredentials(true) 58 | .allowedMethods("GET", "POST", "DELETE", "PUT", "OPTIONS") 59 | // .allowedHeaders("authKey","sessionId", "Content-Type") 60 | //.exposedHeaders("authKey", "sessionId") 61 | .maxAge(3600); 62 | } 63 | 64 | 65 | @Override 66 | public void addInterceptors(InterceptorRegistry registry) { 67 | // 多个拦截器组成一个拦截器链 68 | // addPathPatterns 用于添加拦截规则 69 | // excludePathPatterns 用户排除拦截 70 | registry.addInterceptor(loginInterceptor).addPathPatterns("/admin/**") 71 | .excludePathPatterns("/admin/login", "/admin/logout", "/admin/configs", "/admin/verify", "/static/**", "/upload/**", "/resoures/**", "swagger-resources/**","/v2/api-docs") 72 | ; 73 | super.addInterceptors(registry); 74 | } 75 | 76 | 77 | /** 78 | * 文件上传临时路径 79 | *//* 80 | @Bean 81 | MultipartConfigElement multipartConfigElement() { 82 | MultipartConfigFactory factory = new MultipartConfigFactory(); 83 | factory.setLocation("/src/main/resources"); 84 | return factory.createMultipartConfig(); 85 | }*/ 86 | } 87 | 88 | 89 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 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 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | true 73 | 74 | 75 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/system/menu/add.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-config-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cloud-config-server 7 | 1.0.0 8 | jar 9 | 10 | cloud-config-server 11 | cloud-config-server 12 | 13 | 14 | com.framework 15 | cloud-vue-parent 16 | 1.0.0 17 | 18 | 19 | 20 | UTF-8 21 | 1.8 22 | cloud-vue 23 | 24 | 25 | 26 | 27 | org.springframework.cloud 28 | spring-cloud-config-server 29 | 30 | 31 | org.springframework.cloud 32 | spring-cloud-starter-eureka-server 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-test 37 | test 38 | 39 | 40 | org.springframework.boot 41 | spring-boot-devtools 42 | true 43 | 44 | 45 | 46 | 47 | 48 | 49 | org.springframework.boot 50 | spring-boot-maven-plugin 51 | 52 | true 53 | 54 | 55 | 56 | maven-resources-plugin 57 | 3.0.1 58 | 59 | 60 | prepare-dockerfile 61 | validate 62 | 63 | copy-resources 64 | 65 | 66 | ${project.build.directory}/docker 67 | 68 | 69 | ${project.basedir}/src/main/docker 70 | true 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | com.spotify 79 | docker-maven-plugin 80 | ${docker.plugin.version} 81 | 82 | 83 | package 84 | 85 | build 86 | 87 | 88 | 89 | 90 | ${docker.image.prefix}/${project.artifactId} 91 | ${project.basedir}/src/main/docker 92 | 93 | 94 | / 95 | ${project.build.directory} 96 | ${project.build.finalName}.jar 97 | 98 | 99 | 100 | 101 | 102 | compile 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /back-end/cloud-vue-parent/cloud-simple-service/src/main/java/cloud/simple/service/model/SysAdminUser.java: -------------------------------------------------------------------------------- 1 | package cloud.simple.service.model; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Table; 5 | 6 | import cloud.simple.service.base.BaseEntity; 7 | 8 | @Table(name = "`sys_admin_user`") 9 | public class SysAdminUser extends BaseEntity { 10 | private static final long serialVersionUID = -6695722256864729383L; 11 | 12 | /** 13 | * 管理后台账号 14 | */ 15 | @Column(name = "`username`") 16 | private String username; 17 | 18 | /** 19 | * 管理后台密码 20 | */ 21 | @Column(name = "`password`") 22 | private String password; 23 | 24 | /** 25 | * 用户备注 26 | */ 27 | @Column(name = "`remark`") 28 | private String remark; 29 | 30 | @Column(name = "`create_time`") 31 | private Integer createTime; 32 | 33 | /** 34 | * 真实姓名 35 | */ 36 | @Column(name = "`realname`") 37 | private String realname; 38 | 39 | /** 40 | * 部门 41 | */ 42 | @Column(name = "`structure_id`") 43 | private Integer structureId; 44 | 45 | /** 46 | * 岗位 47 | */ 48 | @Column(name = "`post_id`") 49 | private Integer postId; 50 | 51 | /** 52 | * 状态,1启用0禁用 53 | */ 54 | @Column(name = "`status`") 55 | private Byte status; 56 | 57 | 58 | /** 59 | * 获取管理后台账号 60 | * 61 | * @return username - 管理后台账号 62 | */ 63 | public String getUsername() { 64 | return username; 65 | } 66 | 67 | /** 68 | * 设置管理后台账号 69 | * 70 | * @param username 管理后台账号 71 | */ 72 | public void setUsername(String username) { 73 | this.username = username; 74 | } 75 | 76 | /** 77 | * 获取管理后台密码 78 | * 79 | * @return password - 管理后台密码 80 | */ 81 | public String getPassword() { 82 | return password; 83 | } 84 | 85 | /** 86 | * 设置管理后台密码 87 | * 88 | * @param password 管理后台密码 89 | */ 90 | public void setPassword(String password) { 91 | this.password = password; 92 | } 93 | 94 | /** 95 | * 获取用户备注 96 | * 97 | * @return remark - 用户备注 98 | */ 99 | public String getRemark() { 100 | return remark; 101 | } 102 | 103 | /** 104 | * 设置用户备注 105 | * 106 | * @param remark 用户备注 107 | */ 108 | public void setRemark(String remark) { 109 | this.remark = remark; 110 | } 111 | 112 | /** 113 | * @return create_time 114 | */ 115 | public Integer getCreateTime() { 116 | return createTime; 117 | } 118 | 119 | /** 120 | * @param createTime 121 | */ 122 | public void setCreateTime(Integer createTime) { 123 | this.createTime = createTime; 124 | } 125 | 126 | /** 127 | * 获取真实姓名 128 | * 129 | * @return realname - 真实姓名 130 | */ 131 | public String getRealname() { 132 | return realname; 133 | } 134 | 135 | /** 136 | * 设置真实姓名 137 | * 138 | * @param realname 真实姓名 139 | */ 140 | public void setRealname(String realname) { 141 | this.realname = realname; 142 | } 143 | 144 | /** 145 | * 获取部门 146 | * 147 | * @return structure_id - 部门 148 | */ 149 | public Integer getStructureId() { 150 | return structureId; 151 | } 152 | 153 | /** 154 | * 设置部门 155 | * 156 | * @param structureId 部门 157 | */ 158 | public void setStructureId(Integer structureId) { 159 | this.structureId = structureId; 160 | } 161 | 162 | /** 163 | * 获取岗位 164 | * 165 | * @return post_id - 岗位 166 | */ 167 | public Integer getPostId() { 168 | return postId; 169 | } 170 | 171 | /** 172 | * 设置岗位 173 | * 174 | * @param postId 岗位 175 | */ 176 | public void setPostId(Integer postId) { 177 | this.postId = postId; 178 | } 179 | 180 | /** 181 | * 获取状态,1启用0禁用 182 | * 183 | * @return status - 状态,1启用0禁用 184 | */ 185 | public Byte getStatus() { 186 | return status; 187 | } 188 | 189 | /** 190 | * 设置状态,1启用0禁用 191 | * 192 | * @param status 状态,1启用0禁用 193 | */ 194 | public void setStatus(Byte status) { 195 | this.status = status; 196 | } 197 | } -------------------------------------------------------------------------------- /fore-end/cloud-vue/src/components/Administrative/structures/groups/add.vue: -------------------------------------------------------------------------------- 1 | 55 | --------------------------------------------------------------------------------