├── .gitattributes ├── .gitignore ├── README.md ├── img ├── 1.login.png ├── 10.reportList2.png ├── 2.register.png ├── 3.reportList.png ├── 4.createReport.png ├── 5.readReport.png ├── 6.profile.png ├── 7.password.png ├── 8.userList.png ├── 9.readUser.png ├── database.png ├── project-back.png └── project-front.png ├── pom.xml ├── src ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── sens │ │ │ ├── Application.java │ │ │ ├── config │ │ │ ├── MvcConfig.java │ │ │ ├── MybatisPlusConfig.java │ │ │ ├── annotation │ │ │ │ └── SystemLog.java │ │ │ └── aop │ │ │ │ └── SystemLogAspect.java │ │ │ ├── controller │ │ │ ├── CategoryController.java │ │ │ ├── MainController.java │ │ │ ├── ReportController.java │ │ │ └── UserController.java │ │ │ ├── entity │ │ │ ├── Category.java │ │ │ ├── Log.java │ │ │ ├── Report.java │ │ │ └── User.java │ │ │ ├── enums │ │ │ ├── ApprovalState.java │ │ │ ├── LogTypeEnum.java │ │ │ └── UserType.java │ │ │ ├── mapper │ │ │ ├── CategoryMapper.java │ │ │ ├── LogMapper.java │ │ │ ├── ReportMapper.java │ │ │ └── UserMapper.java │ │ │ ├── service │ │ │ ├── CategoryService.java │ │ │ ├── LogService.java │ │ │ ├── ReportService.java │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ │ ├── CategoryServiceImpl.java │ │ │ │ ├── LogServiceImpl.java │ │ │ │ ├── ReportServiceImpl.java │ │ │ │ └── UserServiceImpl.java │ │ │ └── util │ │ │ ├── FileUtil.java │ │ │ ├── IpInfoUtil.java │ │ │ ├── Response.java │ │ │ └── SpringUtil.java │ └── resources │ │ ├── application.yml │ │ ├── mapper │ │ ├── CategoryMapper.xml │ │ ├── LogMapper.xml │ │ ├── ReportMapper.xml │ │ └── UserMapper.xml │ │ └── static │ │ └── static │ │ ├── css │ │ ├── app.260fd38757c8d00ad9ef739ca97bb2c9.css │ │ ├── color-dark.css │ │ ├── datasource.css │ │ ├── main.css │ │ └── theme-green │ │ │ ├── color-green.css │ │ │ ├── fonts │ │ │ ├── element-icons.ttf │ │ │ └── element-icons.woff │ │ │ └── index.css │ │ ├── data.json │ │ ├── datasource.json │ │ ├── fonts │ │ └── element-icons.b02bdc1.ttf │ │ ├── img │ │ ├── img.jpg │ │ ├── success.jpg │ │ └── tree.png │ │ ├── js │ │ ├── 0.b384da680e4e1a5ae82a.js │ │ ├── 1.9c310ee8ce3d29c34f8a.js │ │ ├── 10.80057f4ce3fd91455eb1.js │ │ ├── 11.2c57e902036e1bc1f92d.js │ │ ├── 12.32065accb6867acd14ee.js │ │ ├── 2.7d4963d07788a6b5a632.js │ │ ├── 3.6f194d0bdcbaca703ede.js │ │ ├── 4.d035e2995ccaa7c8236e.js │ │ ├── 5.c881a9033687cf57ea51.js │ │ ├── 6.35d822c9c7b7542126a8.js │ │ ├── 7.9c34854aa999971653ca.js │ │ ├── 8.23d1f0997c07112908dc.js │ │ ├── 9.792d2c9b22405709d0d3.js │ │ ├── app.59465b2d30e0a9a61f09.js │ │ ├── manifest.f189ff2d76d27176ffaa.js │ │ ├── vendor.dll.js │ │ └── vendor.f36eef38baace209a2a4.js │ │ └── vuetable.json └── test │ └── java │ └── com │ └── example │ └── sens │ └── ApplicationTests.java └── 部署说明.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=Java 2 | *.css linguist-language=Java 3 | *.html linguist-language=jsp 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | logs/ 3 | out/ 4 | !.mvn/wrapper/maven-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | log/ 21 | 22 | ### NetBeans ### 23 | nbproject/private/ 24 | build/ 25 | nbbuild/ 26 | dist/ 27 | nbdist/ 28 | .nb-gradle/ 29 | 30 | ### Mac 31 | .DS_Store 32 | */.DS_Store 33 | 34 | ### VS Code ### 35 | *.project 36 | *.factorypath 37 | 38 | ### 屏蔽,需要完整代码联系博主:微信847064370 39 | *.html 40 | templates/ 41 | webapp/ 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 项目介绍 2 | 该项目基于 SpringBoot 2.x + Vue Element UI 实现,该项目目前是一个信访系统,有用户、事业单位员工和领导三种业务角色。 3 | 大家可以根据自己的需求随便改成其他系统。 4 | 5 | ## 技术组成 6 | - Vue2.x 7 | - SpringBoot 2.x 8 | - MyBatis / MyBatis Plus 9 | - MySQL 10 | 11 | ## 项目结构 12 | 1. 后台结构 13 | ![后台结构](img/project-back.png) 14 | 15 | 2. 前端结构 16 | ![后台结构](img/project-front.png) 17 | 18 | 3. 数据库结构 19 | ![后台结构](img/database.png) 20 | 注:其中log表是用户操作记录表,根据AOP实现 21 | 22 | 23 | ## 项目预览 24 | 1. 登录页面 25 | ![登录页面](img/1.login.png) 26 | 27 | 28 | 2. 注册页面 29 | ![注册页面](img/2.register.png) 30 | 31 | 32 | 3. 案件列表 33 | ![注册页面](img/3.reportList.png) 34 | 35 | 36 | 4. 创建案件 37 | ![创建案件](img/4.createReport.png) 38 | 39 | 40 | 5. 案件详情 41 | ![案件详情](img/5.readReport.png) 42 | 43 | 44 | 6. 个人信息 45 | ![个人信息](img/6.profile.png) 46 | 47 | 48 | 7. 修改密码 49 | ![修改密码](img/7.password.png) 50 | 51 | 52 | ## 关于前端代码 53 | 目前已经把前端代码打包放到 static 目录,可以直接访问使用。
54 | 前端 vue 代码将放在另一个仓库 [http://github.com/saysky/vue-petition-system](http://github.com/saysky/vue-petition-system)
55 | 或者联系博主:微信 847064370 获取 56 | 57 | -------------------------------------------------------------------------------- /img/1.login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/1.login.png -------------------------------------------------------------------------------- /img/10.reportList2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/10.reportList2.png -------------------------------------------------------------------------------- /img/2.register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/2.register.png -------------------------------------------------------------------------------- /img/3.reportList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/3.reportList.png -------------------------------------------------------------------------------- /img/4.createReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/4.createReport.png -------------------------------------------------------------------------------- /img/5.readReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/5.readReport.png -------------------------------------------------------------------------------- /img/6.profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/6.profile.png -------------------------------------------------------------------------------- /img/7.password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/7.password.png -------------------------------------------------------------------------------- /img/8.userList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/8.userList.png -------------------------------------------------------------------------------- /img/9.readUser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/9.readUser.png -------------------------------------------------------------------------------- /img/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/database.png -------------------------------------------------------------------------------- /img/project-back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/project-back.png -------------------------------------------------------------------------------- /img/project-front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/img/project-front.png -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | com.example 6 | petition-system-server 7 | latest 8 | petition-system-server 9 | 10 | 11 | 12 | 信访系统 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter-parent 18 | 2.1.7.RELEASE 19 | 20 | 21 | 22 | 23 | UTF-8 24 | UTF-8 25 | 1.8 26 | 0.0.3 27 | 1.1.10 28 | 1.18.2 29 | 3.6.0 30 | 1.0 31 | 3.8 32 | 4.1.13 33 | 2.3.0 34 | 35 | 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-web 41 | 42 | 43 | org.springframework.boot 44 | spring-boot-starter-tomcat 45 | 46 | 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-starter-test 52 | test 53 | 54 | 55 | 56 | 57 | org.springframework.boot 58 | spring-boot-starter-undertow 59 | 60 | 61 | 62 | 63 | com.baomidou 64 | mybatisplus-spring-boot-starter 65 | 1.0.5 66 | 67 | 68 | com.baomidou 69 | mybatis-plus 70 | 2.1.8 71 | 72 | 73 | org.springframework.boot 74 | spring-boot-starter-jdbc 75 | 76 | 77 | 78 | 79 | 80 | mysql 81 | mysql-connector-java 82 | runtime 83 | 84 | 85 | 86 | 87 | 88 | com.alibaba 89 | druid-spring-boot-starter 90 | ${druid.version} 91 | 92 | 93 | 94 | 95 | 96 | org.projectlombok 97 | lombok 98 | ${lombok.version} 99 | provided 100 | 101 | 102 | 103 | 104 | org.ehcache 105 | ehcache 106 | ${ehcache.version} 107 | 108 | 109 | 110 | 111 | org.apache.commons 112 | commons-lang3 113 | ${commons-lang3.version} 114 | 115 | 116 | 117 | 118 | cn.hutool 119 | hutool-all 120 | ${hutool-all.version} 121 | 122 | 123 | 124 | org.springframework.boot 125 | spring-boot-devtools 126 | true 127 | 128 | 129 | 130 | 131 | com.alibaba 132 | fastjson 133 | 1.2.47 134 | 135 | 136 | 137 | com.google.guava 138 | guava 139 | 26.0-jre 140 | 141 | 142 | 143 | org.springframework.boot 144 | spring-boot-starter-aop 145 | 146 | 147 | 148 | 149 | 150 | aliyun 151 | http://maven.aliyun.com/nexus/content/groups/public 152 | 153 | 154 | 155 | 156 | 157 | aliyun 158 | http://maven.aliyun.com/nexus/content/groups/public 159 | 160 | 161 | 162 | 163 | 164 | 165 | org.springframework.boot 166 | spring-boot-maven-plugin 167 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/Application.java: -------------------------------------------------------------------------------- 1 | package com.example.sens; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.cache.annotation.EnableCaching; 8 | import org.springframework.context.ApplicationContext; 9 | import org.springframework.context.annotation.ComponentScan; 10 | import org.springframework.scheduling.annotation.EnableScheduling; 11 | 12 | /** 13 | *
14 |  *     SENS run!
15 |  * 
16 | * 17 | */ 18 | @Slf4j 19 | @SpringBootApplication 20 | @EnableCaching 21 | @EnableScheduling 22 | @MapperScan("com.example.sens.mapper*") 23 | public class Application { 24 | public static void main(String[] args) { 25 | ApplicationContext context = SpringApplication.run(Application.class, args); 26 | String serverPort = context.getEnvironment().getProperty("server.port"); 27 | log.info("SENS started at http://localhost:" + serverPort); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/config/MvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.config; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.*; 6 | 7 | /** 8 | *
 9 |  *     拦截器,资源路径配置
10 |  * 
11 | */ 12 | @Slf4j 13 | @Configuration 14 | public class MvcConfig implements WebMvcConfigurer { 15 | 16 | /** 17 | * 配置静态资源路径 18 | * 19 | * @param registry registry 20 | */ 21 | @Override 22 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 23 | registry.addResourceHandler("/static/**") 24 | .addResourceLocations("classpath:/static/"); 25 | registry.addResourceHandler("/upload/**") 26 | .addResourceLocations("file:///" + System.getProperties().getProperty("user.home") + "/sens/upload/"); 27 | registry.addResourceHandler("/favicon.ico") 28 | .addResourceLocations("classpath:/static/images/favicon.ico"); 29 | } 30 | 31 | 32 | @Override 33 | public void addCorsMappings(CorsRegistry registry) { 34 | registry.addMapping("/**") 35 | .allowCredentials(true) 36 | .allowedHeaders("*") 37 | .allowedOrigins("*") 38 | .allowedMethods("*"); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.config; 2 | 3 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 4 | import com.baomidou.mybatisplus.plugins.PerformanceInterceptor; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | 9 | /** 10 | * @author 言曌 11 | * @date 2018/12/22 下午1:49 12 | */ 13 | 14 | @Configuration 15 | public class MybatisPlusConfig { 16 | 17 | /*** 18 | * plus 的性能优化 19 | * @return 20 | */ 21 | @Bean 22 | public PerformanceInterceptor performanceInterceptor() { 23 | PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor(); 24 | /**/ 25 | performanceInterceptor.setMaxTime(1000); 26 | /**/ 27 | performanceInterceptor.setFormat(true); 28 | return performanceInterceptor; 29 | } 30 | 31 | /** 32 | * mybatis-plus分页插件 33 | */ 34 | @Bean 35 | public PaginationInterceptor paginationInterceptor() { 36 | return new PaginationInterceptor(); 37 | } 38 | 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/config/annotation/SystemLog.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.config.annotation; 2 | 3 | 4 | import com.example.sens.enums.LogTypeEnum; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * 系统日志自定义注解 10 | * @author liuyanzhao 11 | */ 12 | @Target({ElementType.PARAMETER, ElementType.METHOD})//作用于参数或方法上 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Documented 15 | public @interface SystemLog { 16 | 17 | /** 18 | * 日志类型 19 | * @return 20 | */ 21 | LogTypeEnum type(); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/config/aop/SystemLogAspect.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.config.aop; 2 | 3 | import com.example.sens.config.annotation.SystemLog; 4 | import com.example.sens.entity.Log; 5 | import com.example.sens.entity.User; 6 | import com.example.sens.enums.LogTypeEnum; 7 | import com.example.sens.service.LogService; 8 | import com.example.sens.util.IpInfoUtil; 9 | import com.example.sens.util.Response; 10 | import lombok.extern.slf4j.Slf4j; 11 | import org.aspectj.lang.JoinPoint; 12 | import org.aspectj.lang.annotation.AfterReturning; 13 | import org.aspectj.lang.annotation.Aspect; 14 | import org.aspectj.lang.annotation.Before; 15 | import org.aspectj.lang.annotation.Pointcut; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.stereotype.Component; 18 | import org.springframework.web.context.request.RequestContextHolder; 19 | import org.springframework.web.context.request.ServletRequestAttributes; 20 | 21 | import javax.servlet.http.HttpServletRequest; 22 | import java.lang.reflect.Method; 23 | import java.util.Date; 24 | import java.util.HashMap; 25 | import java.util.Map; 26 | 27 | /** 28 | * Spring AOP实现日志管理 29 | * 30 | * @author liuyanzhao 31 | */ 32 | @Aspect 33 | @Component 34 | @Slf4j 35 | public class SystemLogAspect { 36 | 37 | @Autowired 38 | private LogService logService; 39 | 40 | @Autowired(required = false) 41 | private HttpServletRequest request; 42 | 43 | @Autowired 44 | private IpInfoUtil ipInfoUtil; 45 | 46 | /** 47 | * Controller层切点,注解方式 48 | */ 49 | @Pointcut("@annotation(com.example.sens.config.annotation.SystemLog)") 50 | public void controllerAspect() { 51 | 52 | } 53 | 54 | /** 55 | * 前置通知 (在方法执行之前返回)用于拦截Controller层记录用户的操作的开始时间 56 | * 57 | * @param joinPoint 切点 58 | * @throws InterruptedException 59 | */ 60 | @Before("controllerAspect()") 61 | public void doBefore(JoinPoint joinPoint) throws InterruptedException { 62 | 63 | } 64 | 65 | 66 | /** 67 | * 后置通知(在方法执行之后并返回数据) 用于拦截Controller层无异常的操作 68 | * 69 | * @param joinPoint 切点 70 | */ 71 | @AfterReturning(pointcut = "controllerAspect()", returning = "rvt") 72 | public void after(JoinPoint joinPoint, Object rvt) { 73 | 74 | System.out.println(rvt); 75 | try { 76 | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); 77 | Log log = new Log(); 78 | String logType = String.valueOf(getControllerMethodInfo(joinPoint).get("type")); 79 | if (LogTypeEnum.LOGIN.getValue().equals(logType) || LogTypeEnum.REGISTER.getValue().equals(logType)) { 80 | Response response = (Response) rvt; 81 | User user = response.getData(); 82 | log.setUserId(user.getId()); 83 | } else { 84 | Long userId = (Long) request.getSession().getAttribute("session_userId"); 85 | log.setUserId(userId); 86 | } 87 | log.setLogType(logType); 88 | //请求IP 89 | log.setIp(ipInfoUtil.getIpAddr(request)); 90 | log.setCreateTime(new Date()); 91 | logService.saveByLog(log); 92 | } catch (Exception e) { 93 | log.error("AOP后置通知异常", e); 94 | } 95 | } 96 | 97 | /** 98 | * 获取注解中对方法的描述信息 用于Controller层注解 99 | * 100 | * @param joinPoint 切点 101 | * @return 方法描述 102 | * @throws Exception 103 | */ 104 | public static Map getControllerMethodInfo(JoinPoint joinPoint) throws Exception { 105 | 106 | Map map = new HashMap(16); 107 | //获取目标类名 108 | String targetName = joinPoint.getTarget().getClass().getName(); 109 | //获取方法名 110 | String methodName = joinPoint.getSignature().getName(); 111 | //获取相关参数 112 | Object[] arguments = joinPoint.getArgs(); 113 | //生成类对象 114 | Class targetClass = Class.forName(targetName); 115 | //获取该类中的方法 116 | Method[] methods = targetClass.getMethods(); 117 | 118 | String type = ""; 119 | for (Method method : methods) { 120 | if (!method.getName().equals(methodName)) { 121 | continue; 122 | } 123 | Class[] clazzs = method.getParameterTypes(); 124 | if (clazzs.length != arguments.length) { 125 | //比较方法中参数个数与从切点中获取的参数个数是否相同,原因是方法可以重载哦 126 | continue; 127 | } 128 | type = method.getAnnotation(SystemLog.class).type().getValue(); 129 | map.put("type", type); 130 | } 131 | return map; 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/controller/CategoryController.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.controller; 2 | 3 | import com.example.sens.entity.Category; 4 | import com.example.sens.service.CategoryService; 5 | import com.example.sens.util.Response; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * @author 言曌 15 | * @date 2020/5/16 9:47 上午 16 | */ 17 | @RestController 18 | @RequestMapping("/api/category") 19 | public class CategoryController { 20 | 21 | @Autowired 22 | private CategoryService categoryService; 23 | 24 | @GetMapping("/list") 25 | public Response> findAll() { 26 | List categories = categoryService.findAll(); 27 | return Response.yes(categories); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/controller/MainController.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.controller; 2 | 3 | import com.example.sens.config.annotation.SystemLog; 4 | import com.example.sens.enums.LogTypeEnum; 5 | import com.example.sens.util.FileUtil; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.*; 8 | import org.springframework.web.multipart.MultipartFile; 9 | 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | /** 14 | * @author 言曌 15 | * @date 2019-05-08 13:36 16 | */ 17 | 18 | @Controller 19 | public class MainController { 20 | 21 | public static final String prefix = "http://localhost:8080"; 22 | 23 | @GetMapping("/") 24 | public String index() { 25 | return "redirect:/static/index.html"; 26 | } 27 | 28 | @GetMapping("/login") 29 | public String login() { 30 | return "redirect:/static/index.html#/login"; 31 | } 32 | 33 | @GetMapping("/adminLogin") 34 | public String adminLogin() { 35 | return "redirect:/static/index.html#/adminLogin"; 36 | } 37 | 38 | 39 | 40 | 41 | @PostMapping(value = "/api/file/upload", produces = {"application/json;charset=UTF-8"}) 42 | @ResponseBody 43 | @SystemLog(type = LogTypeEnum.UPLOAD_FILE) 44 | public Map uploadFile(@RequestParam("file") MultipartFile file) { 45 | Map map = new HashMap<>(); 46 | String path = null; 47 | try { 48 | path = FileUtil.upload(file); 49 | } catch (Exception e) { 50 | e.printStackTrace(); 51 | } 52 | map.put("path", prefix + path); 53 | return map; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/controller/ReportController.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.controller; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.example.sens.config.annotation.SystemLog; 5 | import com.example.sens.entity.Report; 6 | import com.example.sens.entity.User; 7 | import com.example.sens.enums.ApprovalState; 8 | import com.example.sens.enums.LogTypeEnum; 9 | import com.example.sens.enums.UserType; 10 | import com.example.sens.service.ReportService; 11 | import com.example.sens.service.UserService; 12 | import com.example.sens.util.Response; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.web.bind.annotation.*; 15 | 16 | import javax.servlet.http.HttpSession; 17 | import java.util.Date; 18 | import java.util.Objects; 19 | 20 | /** 21 | * @author 言曌 22 | * @date 2020-05-08 13:10 23 | */ 24 | 25 | @RestController 26 | @RequestMapping("/api/report") 27 | public class ReportController { 28 | 29 | 30 | @Autowired 31 | private ReportService reportService; 32 | 33 | @Autowired 34 | private UserService userService; 35 | 36 | 37 | /** 38 | * 分页列表 39 | * 40 | * @param pageNo 41 | * @param pageSize 42 | * @return 43 | */ 44 | @GetMapping("/paging") 45 | public Response> paging(@RequestParam(value = "keywords", required = false, defaultValue = "") String keywords, 46 | @RequestParam(value = "state", required = false, defaultValue = "") Integer state, 47 | @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo, 48 | @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize, 49 | HttpSession session) { 50 | User user = (User) session.getAttribute("session_user"); 51 | if (user == null) { 52 | return Response.no("请先登录"); 53 | } 54 | Page pageable = new Page(pageNo, pageSize); 55 | Page page; 56 | if (UserType.USER.getValue().equalsIgnoreCase(user.getType())) { 57 | // 用户 58 | page = reportService.findAll(user.getId(), keywords, state, pageable); 59 | } else { 60 | // 管理员 61 | page = reportService.findAll(keywords, state, pageable); 62 | } 63 | 64 | 65 | return Response.yes(page); 66 | } 67 | 68 | 69 | /** 70 | * 创建 71 | * 72 | * @param report 73 | * @return 74 | */ 75 | @PostMapping("/create") 76 | @SystemLog(type = LogTypeEnum.CREATE_REPORT) 77 | public Response createReport(@RequestBody Report report, HttpSession session) { 78 | User user = (User) session.getAttribute("session_user"); 79 | if (user == null) { 80 | return Response.no("请先登录"); 81 | } 82 | report.setUserId(user.getId()); 83 | report.setCreateTime(new Date()); 84 | report.setApprovalState(ApprovalState.NOT_APPROVAL.getValue()); 85 | report.setApprovalTime(null); 86 | reportService.saveByReport(report); 87 | return Response.yes(); 88 | } 89 | 90 | 91 | /** 92 | * 案件详情 93 | * 94 | * @param id 95 | * @return 96 | */ 97 | @GetMapping("/details") 98 | public Response details(@RequestParam("id") Long id, HttpSession session) { 99 | Report report = reportService.findByReportId(id); 100 | if (report == null) { 101 | return Response.no("案件不存在"); 102 | } 103 | report.setUser(userService.findByUserId(report.getUserId())); 104 | 105 | User user = (User) session.getAttribute("session_user"); 106 | if (user == null) { 107 | return Response.no("请先登录"); 108 | } 109 | Boolean allowApproval = false; 110 | if (Objects.equals(user.getType(), UserType.STAFF.getValue())) { 111 | // 待审核,普通员工 112 | if (user.getStaffLevel() == 1 && report.getApprovalState() == 0) { 113 | allowApproval = true; 114 | } else if (user.getStaffLevel() == 2 && report.getApprovalState() == 1) { 115 | allowApproval = true; 116 | } 117 | } else if (Objects.equals(user.getType(), UserType.ADMIN.getValue())) { 118 | allowApproval = true; 119 | } 120 | report.setAllowApproval(allowApproval); 121 | return Response.yes(report); 122 | } 123 | 124 | /** 125 | * 审批通过案件 126 | * 127 | * @param reportParam 128 | * @return 129 | */ 130 | @PostMapping("/pass") 131 | @SystemLog(type = LogTypeEnum.PASS_REPORT) 132 | public Response pass(@RequestBody Report reportParam, 133 | HttpSession session) { 134 | User user = (User) session.getAttribute("session_user"); 135 | if (user == null) { 136 | return Response.no("请先登录"); 137 | } 138 | if (Objects.equals(user.getType(), UserType.USER.getValue())) { 139 | return Response.no("只有管理员可以审批"); 140 | } 141 | 142 | Report report = reportService.findByReportId(reportParam.getId()); 143 | if (report == null) { 144 | return Response.no("案件不存在"); 145 | } 146 | report.setApprovalSuggestion(reportParam.getApprovalSuggestion()); 147 | if (user.getStaffLevel() == 1) { 148 | report.setApprovalState(1); 149 | } else { 150 | report.setApprovalState(2); 151 | report.setApprovalTime(new Date()); 152 | } 153 | reportService.saveByReport(report); 154 | return Response.yes(true); 155 | } 156 | 157 | 158 | /** 159 | * 审批驳回案件 160 | * 161 | * @param reportParam 162 | * @return 163 | */ 164 | @PostMapping("/refuse") 165 | @SystemLog(type = LogTypeEnum.REFUSE_REPORT) 166 | public Response refuse(@RequestBody Report reportParam, 167 | HttpSession session) { 168 | User user = (User) session.getAttribute("session_user"); 169 | if (user == null) { 170 | return Response.no("请先登录"); 171 | } 172 | if (Objects.equals(user.getType(), UserType.USER.getValue())) { 173 | return Response.no("没有权限"); 174 | } 175 | 176 | Report report = reportService.findByReportId(reportParam.getId()); 177 | report.setApprovalSuggestion(reportParam.getApprovalSuggestion()); 178 | if (report == null) { 179 | return Response.no("案件不存在"); 180 | } 181 | report.setApprovalState(ApprovalState.REFUSE.getValue()); 182 | report.setApprovalTime(new Date()); 183 | reportService.saveByReport(report); 184 | return Response.yes(true); 185 | } 186 | 187 | /** 188 | * 审查案件 189 | * 190 | * @param id 191 | * @return 192 | */ 193 | @PostMapping("/delete") 194 | @SystemLog(type = LogTypeEnum.DELETE_REPORT) 195 | public Response deleteReport(@RequestParam("id") Long id, 196 | HttpSession session) { 197 | User user = (User) session.getAttribute("session_user"); 198 | if (user == null) { 199 | return Response.no("请先登录"); 200 | } 201 | if (!Objects.equals(user.getType(), UserType.ADMIN.getValue())) { 202 | return Response.no("没有权限"); 203 | } 204 | reportService.removeReport(id); 205 | return Response.yes(true); 206 | } 207 | 208 | } 209 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.controller; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.example.sens.config.annotation.SystemLog; 5 | import com.example.sens.entity.Report; 6 | import com.example.sens.entity.User; 7 | import com.example.sens.enums.LogTypeEnum; 8 | import com.example.sens.enums.UserType; 9 | import com.example.sens.service.UserService; 10 | import com.example.sens.util.Response; 11 | import org.apache.commons.lang3.StringUtils; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.http.MediaType; 14 | import org.springframework.web.bind.annotation.*; 15 | 16 | import javax.servlet.http.HttpSession; 17 | import java.util.Date; 18 | import java.util.Objects; 19 | 20 | /** 21 | * @author 言曌 22 | * @date 2019-05-08 13:10 23 | */ 24 | 25 | @RestController 26 | @RequestMapping("/api/user") 27 | public class UserController { 28 | 29 | 30 | @Autowired 31 | private UserService userService; 32 | 33 | 34 | @PostMapping(value = "/login", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) 35 | @SystemLog(type = LogTypeEnum.LOGIN) 36 | public Response login(@RequestBody User user, 37 | HttpSession session) { 38 | User u = userService.findByUserName(user.getName()); 39 | if (u == null || UserType.ADMIN.getValue().equals(u.getType())) { 40 | return Response.no("用户名不存在!"); 41 | } 42 | if (!Objects.equals(u.getPassword(), user.getPassword())) { 43 | return Response.no("密码不正确!"); 44 | } 45 | session.setAttribute("session_userId", u.getId()); 46 | session.setAttribute("session_username", u.getName()); 47 | session.setAttribute("session_user", u); 48 | return Response.yes("登录成功", u); 49 | } 50 | 51 | @PostMapping(value = "/adminLogin", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) 52 | @SystemLog(type = LogTypeEnum.ADMIN_LOGIN) 53 | public Response adminLogin(@RequestBody User user, 54 | HttpSession session) { 55 | User u = userService.findByUserName(user.getName()); 56 | if (u == null || !UserType.ADMIN.getValue().equals(u.getType())) { 57 | return Response.no("用户名不存在!"); 58 | } 59 | if (!Objects.equals(u.getPassword(), user.getPassword())) { 60 | return Response.no("密码不正确!"); 61 | } 62 | session.setAttribute("session_userId", u.getId()); 63 | session.setAttribute("session_username", u.getName()); 64 | session.setAttribute("session_user", u); 65 | return Response.yes("登录成功", u); 66 | } 67 | 68 | @PostMapping("/register") 69 | @SystemLog(type = LogTypeEnum.REGISTER) 70 | public Response register(@RequestBody User user) { 71 | User checkName = userService.findByUserName(user.getName()); 72 | if (checkName != null) { 73 | return Response.no("用户名已注册!"); 74 | } 75 | 76 | User checkPhone = userService.findByPhone(user.getPhone()); 77 | if (checkPhone != null) { 78 | return Response.no("手机号已注册!"); 79 | } 80 | 81 | User checkEmail = userService.findByEmail(user.getEmail()); 82 | if (checkEmail != null) { 83 | return Response.no("电子邮箱已注册!"); 84 | } 85 | 86 | User checkCard = userService.findByCard(user.getCard()); 87 | if (checkCard != null) { 88 | return Response.no("身份证已注册!"); 89 | } 90 | 91 | user.setId(null); 92 | user.setCreateTime(new Date()); 93 | user.setType(UserType.USER.getValue()); 94 | userService.saveByUser(user); 95 | return Response.yes("注册成功", user); 96 | } 97 | 98 | 99 | @GetMapping("/logout") 100 | public Response logout(HttpSession session) { 101 | session.removeAttribute("session_user"); 102 | session.removeAttribute("session_userId"); 103 | session.removeAttribute("session_username"); 104 | return Response.yes(); 105 | } 106 | 107 | @GetMapping("/current") 108 | public Response login(HttpSession session) { 109 | User user = (User) session.getAttribute("session_user"); 110 | if (user == null) { 111 | return Response.no("用户未登录"); 112 | } 113 | return Response.yes(user); 114 | } 115 | 116 | @PostMapping("/profile/save") 117 | @SystemLog(type = LogTypeEnum.UPDATE_PROFILE) 118 | public Response addUser(@RequestBody User userParam, HttpSession session) { 119 | User user = (User) session.getAttribute("session_user"); 120 | if (user == null) { 121 | return Response.no("用户未登录"); 122 | } 123 | userParam.setId(user.getId()); 124 | 125 | User checkName = userService.findByUserName(userParam.getName()); 126 | if (checkName != null && !Objects.equals(checkName.getId(), user.getId())) { 127 | return Response.no("用户名已注册!"); 128 | } 129 | 130 | User checkPhone = userService.findByPhone(userParam.getPhone()); 131 | if (checkPhone != null && !Objects.equals(checkPhone.getId(), user.getId())) { 132 | return Response.no("手机号已注册!"); 133 | } 134 | 135 | User checkEmail = userService.findByEmail(userParam.getEmail()); 136 | if (checkEmail != null && !Objects.equals(checkEmail.getId(), user.getId())) { 137 | return Response.no("电子邮箱已注册!"); 138 | } 139 | 140 | User checkCard = userService.findByCard(userParam.getCard()); 141 | if (checkCard != null && !Objects.equals(checkCard.getId(), user.getId())) { 142 | return Response.no("身份证已注册!"); 143 | } 144 | 145 | 146 | try { 147 | userService.saveByUser(userParam); 148 | } catch (Exception e) { 149 | e.printStackTrace(); 150 | return Response.no(); 151 | } 152 | 153 | session.setAttribute("session_userId", userParam.getId()); 154 | session.setAttribute("session_username", userParam.getName()); 155 | session.setAttribute("session_user", userParam); 156 | return Response.yes("保存成功", null); 157 | } 158 | 159 | @PostMapping("/profile/changePass") 160 | @SystemLog(type = LogTypeEnum.UPDATE_PASSWORD) 161 | public Response changePass(@RequestBody User userParam, HttpSession session) { 162 | User user = (User) session.getAttribute("session_user"); 163 | if (user == null) { 164 | return Response.no("用户未登录"); 165 | } 166 | userParam.setId(user.getId()); 167 | if (StringUtils.isEmpty(userParam.getPassword())) { 168 | return Response.no("密码不能为空"); 169 | } 170 | 171 | try { 172 | userService.saveByUser(userParam); 173 | } catch (Exception e) { 174 | e.printStackTrace(); 175 | return Response.no(); 176 | } 177 | return Response.yes("保存成功", null); 178 | } 179 | 180 | 181 | /** 182 | * 分页列表 183 | * 184 | * @param pageNo 185 | * @param pageSize 186 | * @return 187 | */ 188 | @GetMapping("/paging") 189 | public Response> paging(@RequestParam(value = "keywords", required = false, defaultValue = "") String keywords, 190 | @RequestParam(value = "type", required = false, defaultValue = "") String type, 191 | @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo, 192 | @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize, 193 | HttpSession session) { 194 | User user = (User) session.getAttribute("session_user"); 195 | if (user == null) { 196 | return Response.no("请先登录"); 197 | } 198 | if (!Objects.equals(user.getType(), UserType.ADMIN.getValue())) { 199 | return Response.no("没有权限"); 200 | } 201 | Page pageable = new Page(pageNo, pageSize); 202 | Page page = userService.findAll(keywords, type, pageable); 203 | return Response.yes(page); 204 | } 205 | 206 | /** 207 | * 审查用户 208 | * 209 | * @param id 210 | * @return 211 | */ 212 | @PostMapping("/delete") 213 | @SystemLog(type = LogTypeEnum.DELETE_USER) 214 | public Response deleteReport(@RequestParam("id") Long id, 215 | HttpSession session) { 216 | User user = (User) session.getAttribute("session_user"); 217 | if (user == null) { 218 | return Response.no("请先登录"); 219 | } 220 | if (!Objects.equals(user.getType(), UserType.ADMIN.getValue())) { 221 | return Response.no("没有权限"); 222 | } 223 | 224 | User u = userService.findByUserId(id); 225 | if (u == null) { 226 | return Response.no("用户不存在"); 227 | } 228 | if (UserType.ADMIN.getValue().equals(u.getType())) { 229 | return Response.no("不能删除管理员"); 230 | } 231 | 232 | userService.removeUser(id); 233 | return Response.yes(true); 234 | } 235 | 236 | @GetMapping("/details") 237 | public Response details(@RequestParam("id") Long id, HttpSession session) { 238 | User user = (User) session.getAttribute("session_user"); 239 | if (user == null) { 240 | return Response.no("用户未登录"); 241 | } 242 | if (!Objects.equals(user.getType(), UserType.ADMIN.getValue())) { 243 | return Response.no("没有权限"); 244 | } 245 | User u = userService.findByUserId(id); 246 | return Response.yes(u); 247 | } 248 | 249 | @PostMapping("/create") 250 | @SystemLog(type = LogTypeEnum.ADD_USER) 251 | public Response create(@RequestBody User user) { 252 | User checkName = userService.findByUserName(user.getName()); 253 | if (checkName != null) { 254 | return Response.no("用户名已注册!"); 255 | } 256 | 257 | User checkPhone = userService.findByPhone(user.getPhone()); 258 | if (checkPhone != null) { 259 | return Response.no("手机号已注册!"); 260 | } 261 | 262 | User checkEmail = userService.findByEmail(user.getEmail()); 263 | if (checkEmail != null) { 264 | return Response.no("电子邮箱已注册!"); 265 | } 266 | 267 | User checkCard = userService.findByCard(user.getCard()); 268 | if (checkCard != null) { 269 | return Response.no("身份证已注册!"); 270 | } 271 | 272 | user.setId(null); 273 | user.setCreateTime(new Date()); 274 | userService.saveByUser(user); 275 | return Response.yes("注册成功", user); 276 | } 277 | 278 | @PostMapping("/update") 279 | @SystemLog(type = LogTypeEnum.UPDATE_USER) 280 | public Response update(@RequestBody User user) { 281 | if(user.getId() == null) { 282 | return create(user); 283 | } 284 | 285 | User checkName = userService.findByUserName(user.getName()); 286 | if (checkName != null && !Objects.equals(user.getId(), checkName.getId())) { 287 | return Response.no("用户名已注册!"); 288 | } 289 | 290 | User checkPhone = userService.findByPhone(user.getPhone()); 291 | if (checkPhone != null && !Objects.equals(user.getId(), checkPhone.getId())) { 292 | return Response.no("手机号已注册!"); 293 | } 294 | 295 | User checkEmail = userService.findByEmail(user.getEmail()); 296 | if (checkEmail != null && !Objects.equals(user.getId(), checkEmail.getId())) { 297 | return Response.no("电子邮箱已注册!"); 298 | } 299 | 300 | User checkCard = userService.findByCard(user.getCard()); 301 | if (checkCard != null && !Objects.equals(user.getId(), checkCard.getId())) { 302 | return Response.no("身份证已注册!"); 303 | } 304 | 305 | userService.saveByUser(user); 306 | return Response.yes("更新成功", user); 307 | } 308 | } 309 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/entity/Category.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import com.baomidou.mybatisplus.enums.IdType; 6 | import lombok.Data; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | * @author 言曌 12 | * @date 2020/5/15 10:26 下午 13 | */ 14 | @Data 15 | @TableName("category") 16 | public class Category implements Serializable { 17 | 18 | /** 19 | * ID 20 | */ 21 | @TableId(type = IdType.AUTO) 22 | private Long id; 23 | 24 | private String title; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/entity/Log.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableName; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | import java.util.Date; 8 | 9 | 10 | /** 11 | * @author 12 | */ 13 | @Data 14 | @TableName("log") 15 | public class Log implements Serializable { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | private Long id; 20 | /** 21 | * 日志类型 22 | */ 23 | private String logType; 24 | 25 | /** 26 | * 请求用户 27 | */ 28 | private Long userId; 29 | 30 | /** 31 | * ip 32 | */ 33 | private String ip; 34 | 35 | 36 | private Date createTime; 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/entity/Report.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableField; 4 | import com.baomidou.mybatisplus.annotations.TableId; 5 | import com.baomidou.mybatisplus.enums.IdType; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import lombok.Data; 8 | 9 | import java.io.Serializable; 10 | import java.util.Date; 11 | import java.util.List; 12 | 13 | /** 14 | * (Report)实体类 15 | * 16 | * @since 2020-05-12 23:04:12 17 | */ 18 | @Data 19 | public class Report implements Serializable { 20 | private static final long serialVersionUID = -63046033306671906L; 21 | /** 22 | * 案件ID 23 | */ 24 | @TableId(type = IdType.AUTO) 25 | private Long id; 26 | /** 27 | * 用户ID 28 | */ 29 | private Long userId; 30 | /** 31 | * 标题 32 | */ 33 | private String title; 34 | /** 35 | * 内容 36 | */ 37 | private String content; 38 | /** 39 | * 类型 40 | */ 41 | private Long categoryId; 42 | /** 43 | * 审批时间 44 | */ 45 | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 46 | private Date approvalTime; 47 | /** 48 | * 创建时间 49 | */ 50 | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 51 | private Date createTime; 52 | /** 53 | * 审批状态:0待审批,1已完成初级审批,2领导审批通过,-1驳回 54 | */ 55 | private Integer approvalState; 56 | 57 | /** 58 | * 发送地点 59 | */ 60 | private String place; 61 | 62 | /** 63 | * 附件URL 64 | */ 65 | private String attachmentUrl; 66 | 67 | /** 68 | * 审批意见 69 | */ 70 | private String approvalSuggestion; 71 | 72 | @TableField(exist = false) 73 | private String userRealName; 74 | 75 | @TableField(exist = false) 76 | private String categoryTitle; 77 | 78 | @TableField(exist = false) 79 | private User user; 80 | 81 | /** 82 | * 登录用户是否可以继续审核 83 | */ 84 | @TableField(exist = false) 85 | private Boolean allowApproval; 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import com.baomidou.mybatisplus.enums.IdType; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import lombok.Data; 8 | 9 | import javax.validation.constraints.NotBlank; 10 | import java.io.Serializable; 11 | import java.util.Date; 12 | 13 | /** 14 | *
15 |  *     用户信息
16 |  * 
17 | */ 18 | @Data 19 | @TableName("user") 20 | public class User implements Serializable { 21 | 22 | private static final long serialVersionUID = -5144055068797033748L; 23 | 24 | /** 25 | * 用户ID 26 | */ 27 | @TableId(type = IdType.AUTO) 28 | private Long id; 29 | /** 30 | * 用户名 31 | */ 32 | private String name; 33 | /** 34 | * 密码 35 | */ 36 | private String password; 37 | /** 38 | * 姓名 39 | */ 40 | private String realName; 41 | /** 42 | * 性别 43 | */ 44 | private String sex; 45 | /** 46 | * 电子邮箱 47 | */ 48 | private String email; 49 | /** 50 | * 身份证号码 51 | */ 52 | private String card; 53 | /** 54 | * 地址 55 | */ 56 | private String address; 57 | /** 58 | * 手机号 59 | */ 60 | private String phone; 61 | /** 62 | * 用户类型:群众user, 员工staff,管理员 amdin 63 | */ 64 | private String type; 65 | 66 | /** 67 | * 员工等级:普通1,领导2 68 | */ 69 | private Integer staffLevel; 70 | /** 71 | * 创建时间 72 | */ 73 | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 74 | private Date createTime; 75 | /** 76 | * 生日 77 | */ 78 | private Date birth; 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/enums/ApprovalState.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.enums; 2 | 3 | /** 4 | * 审批状态 5 | * @author 言曌 6 | */ 7 | 8 | public enum ApprovalState { 9 | 10 | /** 11 | * 待审批 12 | */ 13 | NOT_APPROVAL(0), 14 | 15 | /** 16 | * 第一次审批通过 17 | */ 18 | FIRST_FINISH(1), 19 | 20 | /** 21 | * 第二次审批通过 22 | */ 23 | SECOND_FINISH(2), 24 | 25 | /** 26 | * 驳回 27 | */ 28 | REFUSE(-1) 29 | 30 | 31 | ; 32 | 33 | 34 | 35 | private Integer value; 36 | 37 | ApprovalState(Integer value) { 38 | this.value = value; 39 | } 40 | 41 | public Integer getValue() { 42 | return value; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/enums/LogTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.enums; 2 | 3 | /** 4 | * @author liuyanzhao 5 | */ 6 | public enum LogTypeEnum { 7 | 8 | /** 9 | * 登录 10 | */ 11 | LOGIN("登录"), 12 | 13 | /** 14 | * 登录 15 | */ 16 | ADMIN_LOGIN("管理员登录"), 17 | 18 | /** 19 | * 注册 20 | */ 21 | REGISTER("注册"), 22 | 23 | /** 24 | * 注册 25 | */ 26 | CREATE_REPORT("发布信访"), 27 | 28 | /** 29 | * 删除用户 30 | */ 31 | DELETE_USER("删除用户"), 32 | 33 | /** 34 | * 添加用户 35 | */ 36 | ADD_USER("添加用户"), 37 | 38 | /** 39 | * 更新用户 40 | */ 41 | UPDATE_USER("更新用户"), 42 | 43 | /** 44 | * 修改个人信息 45 | */ 46 | UPDATE_PROFILE("修改个人信息"), 47 | 48 | /** 49 | * 修改个人信息 50 | */ 51 | UPDATE_PASSWORD("修改个人密码"), 52 | 53 | /** 54 | * 审批通过案件 55 | */ 56 | PASS_REPORT("审批通过案件"), 57 | 58 | /** 59 | * 上传附件 60 | */ 61 | UPLOAD_FILE("上传附件"), 62 | 63 | 64 | /** 65 | * 审批驳回案件 66 | */ 67 | REFUSE_REPORT("审批驳回案件"), 68 | 69 | 70 | /** 71 | * 删除案件 72 | */ 73 | DELETE_REPORT("删除案件"); 74 | 75 | 76 | private String value; 77 | 78 | LogTypeEnum(String value) { 79 | this.value = value; 80 | } 81 | 82 | public String getValue() { 83 | return value; 84 | } 85 | 86 | public void setValue(String value) { 87 | this.value = value; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/enums/UserType.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.enums; 2 | 3 | /** 4 | * 用户类型 5 | * @author 言曌 6 | */ 7 | 8 | public enum UserType { 9 | 10 | /** 11 | * 用户 12 | */ 13 | USER("user"), 14 | 15 | /** 16 | * 普通员工 17 | */ 18 | STAFF("staff"), 19 | 20 | /** 21 | * 管理员 22 | */ 23 | ADMIN("admin"); 24 | 25 | 26 | 27 | private String value; 28 | 29 | UserType(String value) { 30 | this.value = value; 31 | } 32 | 33 | public String getValue() { 34 | return value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/mapper/CategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.mapper; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 5 | import com.example.sens.entity.Category; 6 | import com.example.sens.entity.Report; 7 | import com.example.sens.entity.User; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author 言曌 13 | * @date 2020/5/15 10:25 下午 14 | */ 15 | 16 | public interface CategoryMapper extends BaseMapper { 17 | 18 | List findAll(Pagination pagination); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/mapper/LogMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.mapper; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 5 | import com.example.sens.entity.Log; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author 言曌 11 | * @date 2020/5/15 10:25 下午 12 | */ 13 | 14 | public interface LogMapper extends BaseMapper { 15 | 16 | List findAll(Pagination pagination); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/mapper/ReportMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.mapper; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 5 | import com.example.sens.entity.Report; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author 言曌 13 | * @date 2020/5/15 10:25 下午 14 | */ 15 | @Mapper 16 | public interface ReportMapper extends BaseMapper { 17 | 18 | Report findById(Long id); 19 | 20 | List findAll(@Param("keywords") String keywords, 21 | @Param("state") Integer state, 22 | Pagination pagination); 23 | 24 | List findByUserId(@Param("userId") Long userId, 25 | @Param("keywords") String keywords, 26 | @Param("state") Integer state, 27 | Pagination pagination); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.mapper; 2 | 3 | import com.baomidou.mybatisplus.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 5 | import com.example.sens.entity.User; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | @Mapper 12 | public interface UserMapper extends BaseMapper { 13 | 14 | 15 | List findAll(Pagination pagination); 16 | 17 | List findByKeywords(@Param("keywords") String keywords, 18 | @Param("type") String type, Pagination pagination); 19 | 20 | User findByUserName(String userName); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/service/CategoryService.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.service; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.example.sens.entity.Category; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author 言曌 10 | * @date 2020/5/15 10:24 下午 11 | */ 12 | public interface CategoryService { 13 | 14 | 15 | /** 16 | * 新增/修改分类 17 | * 18 | * @param category category 19 | * @return Role 20 | */ 21 | void saveByCategory(Category category); 22 | 23 | /** 24 | * 根据分类Id获得分类 25 | * 26 | * @param categoryId 分类名 27 | * @return 分类 28 | */ 29 | Category findByCategoryId(Long categoryId); 30 | 31 | /** 32 | * 删除分类 33 | * 34 | * @param categoryId 分类Id 35 | */ 36 | void removeCategory(Long categoryId); 37 | 38 | 39 | /** 40 | * 分页获取分类 41 | * 42 | * @param page 分页 43 | * @return 分页数据 44 | */ 45 | Page findAll(Page page); 46 | 47 | List findAll(); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/service/LogService.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.service; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.example.sens.entity.Log; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author 言曌 10 | * @date 2020/5/15 10:24 下午 11 | */ 12 | public interface LogService { 13 | 14 | 15 | /** 16 | * 新增/修改日志 17 | * 18 | * @param log log 19 | * @return Role 20 | */ 21 | void saveByLog(Log log); 22 | 23 | /** 24 | * 根据日志Id获得日志 25 | * 26 | * @param logId 日志名 27 | * @return 日志 28 | */ 29 | Log findByLogId(Long logId); 30 | 31 | /** 32 | * 删除日志 33 | * 34 | * @param logId 日志Id 35 | */ 36 | void removeLog(Long logId); 37 | 38 | 39 | /** 40 | * 分页获取日志 41 | * 42 | * @param page 分页 43 | * @return 分页数据 44 | */ 45 | Page findAll(Page page); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/service/ReportService.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.service; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.example.sens.entity.Report; 5 | 6 | /** 7 | * @author 言曌 8 | * @date 2020/5/15 10:24 下午 9 | */ 10 | public interface ReportService { 11 | 12 | 13 | /** 14 | * 新增/修改案件 15 | * 16 | * @param report report 17 | * @return Role 18 | */ 19 | void saveByReport(Report report); 20 | 21 | /** 22 | * 根据案件Id获得案件 23 | * 24 | * @param reportId 案件名 25 | * @return 案件 26 | */ 27 | Report findByReportId(Long reportId); 28 | 29 | /** 30 | * 删除案件 31 | * 32 | * @param reportId 案件Id 33 | */ 34 | void removeReport(Long reportId); 35 | 36 | 37 | /** 38 | * 分页获取案件 39 | * 40 | * @param page 分页 41 | * @return 分页数据 42 | */ 43 | Page findAll( String keywords, Integer state, Page page); 44 | 45 | Page findAll(Long userId, String keywords, Integer state, Page page); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.service; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.example.sens.entity.User; 5 | 6 | 7 | /** 8 | *
 9 |  *     用户业务逻辑接口
10 |  * 
11 | */ 12 | public interface UserService { 13 | 14 | /** 15 | * 新增/修改用户 16 | * 17 | * @param user user 18 | * @return Role 19 | */ 20 | void saveByUser(User user); 21 | 22 | /** 23 | * 根据用户名获得用户 24 | * 25 | * @param userName 用户名 26 | * @return 用户 27 | */ 28 | User findByUserName(String userName); 29 | 30 | User findByPhone(String phone); 31 | 32 | User findByCard(String card); 33 | 34 | User findByEmail(String email); 35 | 36 | 37 | /** 38 | * 根据用户Id获得用户 39 | * 40 | * @param userId 用户名 41 | * @return 用户 42 | */ 43 | User findByUserId(Long userId); 44 | 45 | /** 46 | * 删除用户 47 | * 48 | * @param userId 用户Id 49 | */ 50 | void removeUser(Long userId); 51 | 52 | 53 | /** 54 | * 分页获取用户 55 | * 56 | * @param page 分页 57 | * @return 分页数据 58 | */ 59 | Page findAll(String keywords, String type, Page page); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/service/impl/CategoryServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.service.impl; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.example.sens.entity.Category; 5 | import com.example.sens.mapper.CategoryMapper; 6 | import com.example.sens.service.CategoryService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | *
14 |  *     分类业务逻辑实现类
15 |  * 
16 | */ 17 | @Service 18 | public class CategoryServiceImpl implements CategoryService { 19 | 20 | @Autowired(required = false) 21 | private CategoryMapper categoryMapper; 22 | 23 | @Override 24 | public void saveByCategory(Category category) { 25 | if (category != null && category.getId() != null) { 26 | categoryMapper.updateById(category); 27 | } else { 28 | categoryMapper.insert(category); 29 | } 30 | } 31 | 32 | 33 | @Override 34 | public Category findByCategoryId(Long categoryId) { 35 | return categoryMapper.selectById(categoryId); 36 | } 37 | 38 | 39 | @Override 40 | public void removeCategory(Long categoryId) { 41 | categoryMapper.deleteById(categoryId); 42 | } 43 | 44 | @Override 45 | public Page findAll(Page page) { 46 | return page.setRecords(categoryMapper.findAll(page)); 47 | } 48 | 49 | @Override 50 | public List findAll() { 51 | return categoryMapper.selectList(null); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/service/impl/LogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.service.impl; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.example.sens.entity.Log; 5 | import com.example.sens.mapper.LogMapper; 6 | import com.example.sens.service.LogService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | 11 | /** 12 | *
13 |  *     日志业务逻辑实现类
14 |  * 
15 | */ 16 | @Service 17 | public class LogServiceImpl implements LogService { 18 | 19 | @Autowired(required = false) 20 | private LogMapper logMapper; 21 | 22 | @Override 23 | public void saveByLog(Log log) { 24 | if (log != null && log.getId() != null) { 25 | logMapper.updateById(log); 26 | } else { 27 | logMapper.insert(log); 28 | } 29 | } 30 | 31 | 32 | @Override 33 | public Log findByLogId(Long logId) { 34 | return logMapper.selectById(logId); 35 | } 36 | 37 | 38 | @Override 39 | public void removeLog(Long logId) { 40 | logMapper.deleteById(logId); 41 | } 42 | 43 | @Override 44 | public Page findAll(Page page) { 45 | return page.setRecords(logMapper.findAll(page)); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/service/impl/ReportServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.service.impl; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.example.sens.entity.Report; 5 | import com.example.sens.mapper.ReportMapper; 6 | import com.example.sens.service.ReportService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | *
12 |  *     阿那件业务逻辑实现类
13 |  * 
14 | */ 15 | @Service 16 | public class ReportServiceImpl implements ReportService { 17 | 18 | @Autowired(required = false) 19 | private ReportMapper reportMapper; 20 | 21 | @Override 22 | public void saveByReport(Report report) { 23 | if (report != null && report.getId() != null) { 24 | reportMapper.updateById(report); 25 | } else { 26 | reportMapper.insert(report); 27 | } 28 | } 29 | 30 | 31 | @Override 32 | public Report findByReportId(Long reportId) { 33 | return reportMapper.findById(reportId); 34 | } 35 | 36 | 37 | @Override 38 | public void removeReport(Long reportId) { 39 | reportMapper.deleteById(reportId); 40 | } 41 | 42 | @Override 43 | public Page findAll( String keywords, Integer state, Page page) { 44 | return page.setRecords(reportMapper.findAll(keywords, state, page)); 45 | } 46 | 47 | @Override 48 | public Page findAll(Long userId, String keywords, Integer state, Page page) { 49 | return page.setRecords(reportMapper.findByUserId(userId,keywords, state, page)); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.service.impl; 2 | 3 | import com.baomidou.mybatisplus.plugins.Page; 4 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 5 | import com.example.sens.mapper.ReportMapper; 6 | import com.example.sens.mapper.UserMapper; 7 | import com.example.sens.entity.User; 8 | import com.example.sens.service.UserService; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | 12 | import org.springframework.stereotype.Service; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | import java.util.HashMap; 16 | import java.util.Map; 17 | 18 | /** 19 | *
20 |  *     用户业务逻辑实现类
21 |  * 
22 | */ 23 | @Service 24 | public class UserServiceImpl implements UserService { 25 | 26 | @Autowired(required = false) 27 | private UserMapper userMapper; 28 | 29 | @Autowired 30 | private ReportMapper reportMapper; 31 | 32 | @Override 33 | public void saveByUser(User user) { 34 | if (user != null && user.getId() != null) { 35 | userMapper.updateById(user); 36 | } else { 37 | userMapper.insert(user); 38 | } 39 | } 40 | 41 | @Override 42 | public User findByUserName(String userName) { 43 | User param = new User(); 44 | param.setName(userName); 45 | return userMapper.selectOne(param); 46 | } 47 | 48 | @Override 49 | public User findByPhone(String phone) { 50 | User param = new User(); 51 | param.setPhone(phone); 52 | return userMapper.selectOne(param); 53 | } 54 | 55 | @Override 56 | public User findByCard(String card) { 57 | User param = new User(); 58 | param.setCard(card); 59 | return userMapper.selectOne(param); 60 | } 61 | 62 | @Override 63 | public User findByEmail(String email) { 64 | User param = new User(); 65 | param.setEmail(email); 66 | return userMapper.selectOne(param); 67 | } 68 | 69 | @Override 70 | public User findByUserId(Long userId) { 71 | return userMapper.selectById(userId); 72 | } 73 | 74 | 75 | @Override 76 | @Transactional(rollbackFor = Exception.class) 77 | public void removeUser(Long userId) { 78 | 79 | 80 | userMapper.deleteById(userId); 81 | 82 | Map map = new HashMap<>(); 83 | map.put("user_id", userId); 84 | reportMapper.deleteByMap(map); 85 | } 86 | 87 | @Override 88 | public Page findAll(String keywords, String type, Page page) { 89 | return page.setRecords(userMapper.findByKeywords(keywords, type, page)); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/util/FileUtil.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.util; 2 | 3 | import cn.hutool.core.date.DateUtil; 4 | import cn.hutool.core.text.StrBuilder; 5 | import org.springframework.web.multipart.MultipartFile; 6 | 7 | import java.io.File; 8 | import java.io.IOException; 9 | 10 | /** 11 | * @author 言曌 12 | * @date 2020/3/8 5:45 下午 13 | */ 14 | public class FileUtil { 15 | 16 | /** 17 | * 上传文件返回URL 18 | * 19 | * @param file 20 | * @return 21 | */ 22 | public static String upload(MultipartFile file) throws Exception { 23 | String path = ""; 24 | try { 25 | //用户目录 26 | final StrBuilder uploadPath = new StrBuilder(System.getProperties().getProperty("user.home")); 27 | uploadPath.append("/sens/upload/" + DateUtil.thisYear()).append("/").append(DateUtil.thisMonth() + 1).append("/"); 28 | final File mediaPath = new File(uploadPath.toString()); 29 | if (!mediaPath.exists()) { 30 | if (!mediaPath.mkdirs()) { 31 | throw new Exception("上传失败"); 32 | } 33 | } 34 | 35 | //不带后缀 36 | String nameWithOutSuffix = file.getOriginalFilename().substring(0, file.getOriginalFilename().lastIndexOf('.')).replaceAll(" ", "_").replaceAll(",", ""); 37 | 38 | //文件后缀 39 | final String fileSuffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf('.') + 1); 40 | 41 | //带后缀 42 | String fileName = nameWithOutSuffix + "." + fileSuffix; 43 | 44 | //判断文件名是否已存在 45 | File descFile = new File(mediaPath.getAbsoluteFile(), fileName); 46 | int i = 1; 47 | while (descFile.exists()) { 48 | String newNameWithOutSuffix = nameWithOutSuffix + "(" + i + ")"; 49 | descFile = new File(mediaPath.getAbsoluteFile(), newNameWithOutSuffix + "." + fileSuffix); 50 | i++; 51 | } 52 | file.transferTo(descFile); 53 | 54 | //文件原路径 55 | final StrBuilder fullPath = new StrBuilder(mediaPath.getAbsolutePath()); 56 | fullPath.append("/"); 57 | fullPath.append(nameWithOutSuffix + "." + fileSuffix); 58 | 59 | //压缩文件路径 60 | final StrBuilder fullSmallPath = new StrBuilder(mediaPath.getAbsolutePath()); 61 | fullSmallPath.append("/"); 62 | fullSmallPath.append(nameWithOutSuffix); 63 | fullSmallPath.append("_small."); 64 | fullSmallPath.append(fileSuffix); 65 | 66 | //映射路径 67 | final StrBuilder filePath = new StrBuilder("/upload/"); 68 | filePath.append(DateUtil.thisYear()); 69 | filePath.append("/"); 70 | filePath.append(DateUtil.thisMonth() + 1); 71 | filePath.append("/"); 72 | filePath.append(nameWithOutSuffix + "." + fileSuffix); 73 | path = filePath.toString(); 74 | 75 | } catch (IOException e) { 76 | e.printStackTrace(); 77 | } 78 | return path; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/util/IpInfoUtil.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.util; 2 | 3 | 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.stereotype.Component; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import java.net.InetAddress; 9 | import java.net.UnknownHostException; 10 | 11 | 12 | /** 13 | * @author liuyanzhao 14 | */ 15 | @Slf4j 16 | @Component 17 | public class IpInfoUtil { 18 | 19 | /** 20 | * 获取客户端IP地址 21 | * @param request 请求 22 | * @return 23 | */ 24 | public String getIpAddr(HttpServletRequest request) { 25 | 26 | String ip = request.getHeader("x-forwarded-for"); 27 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 28 | ip = request.getHeader("Proxy-Client-IP"); 29 | } 30 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 31 | ip = request.getHeader("WL-Proxy-Client-IP"); 32 | } 33 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 34 | ip = request.getRemoteAddr(); 35 | if ("127.0.0.1".equals(ip)) { 36 | //根据网卡取本机配置的IP 37 | InetAddress inet = null; 38 | try { 39 | inet = InetAddress.getLocalHost(); 40 | } catch (UnknownHostException e) { 41 | e.printStackTrace(); 42 | } 43 | ip = inet.getHostAddress(); 44 | } 45 | } 46 | // 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割 47 | if (ip != null && ip.length() > 15) { 48 | if (ip.indexOf(",") > 0) { 49 | ip = ip.substring(0, ip.indexOf(",")); 50 | } 51 | } 52 | if("0:0:0:0:0:0:0:1".equals(ip)){ 53 | ip = "127.0.0.1"; 54 | } 55 | return ip; 56 | } 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/util/Response.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.util; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Response { 7 | 8 | private Integer code; 9 | 10 | private String msg; 11 | 12 | private T data; 13 | 14 | public Response() { 15 | } 16 | 17 | public Response(Integer code) { 18 | this.code = code; 19 | } 20 | 21 | public Response(Integer code, String msg) { 22 | this.code = code; 23 | this.msg = msg; 24 | } 25 | 26 | public Response(Integer code, String msg, T data) { 27 | this.code = code; 28 | this.msg = msg; 29 | this.data = data; 30 | } 31 | 32 | public static Response yes() { 33 | return new Response(0, "操作成功"); 34 | } 35 | 36 | public static Response yes(String msg,T data) { 37 | return new Response(0, msg, data); 38 | } 39 | 40 | public static Response yes(T data) { 41 | return new Response(0, "操作成功", data); 42 | } 43 | 44 | 45 | public static Response no() { 46 | return new Response(-1, "操作失败"); 47 | } 48 | 49 | public static Response no(String msg) { 50 | return new Response(-1, msg); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/example/sens/util/SpringUtil.java: -------------------------------------------------------------------------------- 1 | package com.example.sens.util; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class SpringUtil implements ApplicationContextAware { 10 | 11 | private static ApplicationContext applicationContext; 12 | 13 | /** 14 | * 获取applicationContext 15 | * 16 | * @return ApplicationContext 17 | */ 18 | public static ApplicationContext getApplicationContext() { 19 | return applicationContext; 20 | } 21 | 22 | @Override 23 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 24 | if (SpringUtil.applicationContext == null) { 25 | SpringUtil.applicationContext = applicationContext; 26 | } 27 | } 28 | 29 | /** 30 | * 通过name获取 Bean. 31 | * 32 | * @param name name 33 | * @return Object 34 | */ 35 | public static Object getBean(String name) { 36 | return getApplicationContext().getBean(name); 37 | } 38 | 39 | /** 40 | * 通过class获取Bean 41 | * 42 | * @param clazz clazz 43 | * @param 44 | * @return T 45 | */ 46 | public static T getBean(Class clazz) { 47 | return getApplicationContext().getBean(clazz); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | use-forward-headers: true 4 | undertow: 5 | io-threads: 2 6 | worker-threads: 36 7 | buffer-size: 1024 8 | directBuffers: true 9 | servlet: 10 | session: 11 | timeout: 86400 12 | spring: 13 | transaction: 14 | rollback-on-commit-failure: true 15 | datasource: 16 | type: com.alibaba.druid.pool.DruidDataSource 17 | 18 | #MySql配置 19 | driver-class-name: com.mysql.jdbc.Driver 20 | url: jdbc:mysql://127.0.0.1:3306/petition_system?characterEncoding=utf8&useSSL=false&allowMultiQueries=true 21 | username: root 22 | password: 123456 23 | devtools: 24 | restart: 25 | enabled: true 26 | 27 | mybatis-plus: 28 | mapper-locations: classpath*:/mapper/**Mapper.xml 29 | #实体扫描,多个package用逗号或者分号分隔 30 | typeAliasesPackage: com.example.sens.entity 31 | global-config: 32 | #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; 33 | id-type: 0 34 | #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" 35 | field-strategy: 2 36 | #驼峰下划线转换 37 | db-column-underline: true 38 | #刷新mapper 调试神器 39 | refresh-mapper: true 40 | #逻辑删除配置(下面3个配置) 41 | logic-delete-value: 0 42 | logic-not-delete-value: 1 43 | configuration: 44 | map-underscore-to-camel-case: true 45 | cache-enabled: true 46 | logging: 47 | file: ./logs/log.log 48 | level: 49 | org: 50 | springframework: 51 | boot: 52 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CategoryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/mapper/LogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/resources/mapper/ReportMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 38 | 39 | 59 | 60 | 67 | 68 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 45 | 46 | 49 | -------------------------------------------------------------------------------- /src/main/resources/static/static/css/app.260fd38757c8d00ad9ef739ca97bb2c9.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/css/app.260fd38757c8d00ad9ef739ca97bb2c9.css -------------------------------------------------------------------------------- /src/main/resources/static/static/css/color-dark.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | background-color: #242f42; 3 | } 4 | .login-wrap{ 5 | background: #324157; 6 | } 7 | .plugins-tips{ 8 | background: #eef1f6; 9 | } 10 | .plugins-tips a{ 11 | color: #20a0ff; 12 | } 13 | .el-upload--text em { 14 | color: #20a0ff; 15 | } 16 | .pure-button{ 17 | background: #20a0ff; 18 | -------------------------------------------------------------------------------- /src/main/resources/static/static/css/datasource.css: -------------------------------------------------------------------------------- 1 | .vue-datasource *{ 2 | box-sizing: border-box; 3 | font-size: 14px; 4 | } 5 | .vue-datasource .panel { 6 | margin-bottom: 22px; 7 | background-color: #fff; 8 | border: 1px solid transparent; 9 | border-radius: 4px; 10 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); 11 | } 12 | .vue-datasource .panel-default { 13 | border-color: #d3e0e9; 14 | } 15 | .vue-datasource .panel-heading { 16 | padding: 10px 15px; 17 | border-bottom: 1px solid transparent; 18 | border-top-right-radius: 3px; 19 | border-top-left-radius: 3px; 20 | } 21 | .vue-datasource .panel-default > .panel-heading { 22 | height:56px; 23 | color: #333333; 24 | background-color: #fff; 25 | border-color: #d3e0e9; 26 | } 27 | .vue-datasource .pull-left { 28 | float: left !important; 29 | } 30 | .vue-datasource .pull-right { 31 | float: right !important; 32 | } 33 | .vue-datasource .form-group { 34 | margin-bottom: 15px; 35 | } 36 | .vue-datasource label { 37 | display: inline-block; 38 | max-width: 100%; 39 | margin-bottom: 5px; 40 | font-weight: bold; 41 | } 42 | .vue-datasource .form-control { 43 | display: block; 44 | width: 100%; 45 | height: 36px; 46 | padding: 6px 12px; 47 | font-size: 14px; 48 | line-height: 1.6; 49 | color: #555555; 50 | background-color: #fff; 51 | background-image: none; 52 | border: 1px solid #ccd0d2; 53 | border-radius: 4px; 54 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 55 | -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; 56 | transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; 57 | } 58 | .vue-datasource .btn { 59 | display: inline-block; 60 | margin-bottom: 0; 61 | font-weight: normal; 62 | text-align: center; 63 | vertical-align: middle; 64 | touch-action: manipulation; 65 | cursor: pointer; 66 | background-image: none; 67 | border: 1px solid transparent; 68 | white-space: nowrap; 69 | padding: 6px 12px; 70 | font-size: 14px; 71 | line-height: 1.6; 72 | border-radius: 4px; 73 | -webkit-user-select: none; 74 | -moz-user-select: none; 75 | -ms-user-select: none; 76 | user-select: none; 77 | } 78 | .vue-datasource .btn-primary { 79 | color: #fff; 80 | background-color: #3097D1; 81 | border-color: #2a88bd; 82 | } 83 | .vue-datasource .table { 84 | width: 100%; 85 | max-width: 100%; 86 | margin-bottom: 22px; 87 | border-collapse: collapse; 88 | border-spacing: 0; 89 | text-align: center; 90 | } 91 | .vue-datasource .table > thead > tr > th { 92 | vertical-align: bottom; 93 | border-bottom: 2px solid #ddd; 94 | } 95 | .vue-datasource .table th ,.vue-datasource .table td { 96 | padding: 8px; 97 | line-height: 1.6; 98 | vertical-align: top; 99 | border-top: 1px solid #ddd; 100 | } 101 | .vue-datasource .table-striped > tbody > tr:nth-of-type(odd) { 102 | background-color: #f9f9f9; 103 | } 104 | .vue-datasource .success th ,.vue-datasource .success td{ 105 | background-color: #dff0d8; 106 | } 107 | .vue-datasource .pagination { 108 | display: inline-block; 109 | padding-left: 0; 110 | margin: 22px 0; 111 | border-radius: 4px; 112 | } 113 | .vue-datasource .pagination > li { 114 | display: inline; 115 | } 116 | .pagination > li > a,.pagination > li > span { 117 | position: relative; 118 | float: left; 119 | padding: 6px 12px; 120 | line-height: 1.6; 121 | text-decoration: none; 122 | color: #3097D1; 123 | background-color: #fff; 124 | border: 1px solid #ddd; 125 | margin-left: -1px; 126 | } 127 | .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { 128 | color: #777777; 129 | background-color: #fff; 130 | border-color: #ddd; 131 | cursor: not-allowed; 132 | } 133 | .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { 134 | z-index: 3; 135 | color: #fff; 136 | background-color: #3097D1; 137 | border-color: #3097D1; 138 | cursor: default; 139 | } 140 | .vue-datasource .pagination > li:first-child > a, .vue-datasource .pagination > li:first-child > span { 141 | margin-left: 0; 142 | border-bottom-left-radius: 4px; 143 | border-top-left-radius: 4px; 144 | } 145 | .vue-datasource .text-center { 146 | text-align: center; 147 | } 148 | 149 | 150 | 151 | 152 | @media (min-width: 768px){ 153 | .form-inline .form-group { 154 | display: inline-block; 155 | margin-bottom: 0; 156 | vertical-align: middle; 157 | } 158 | .form-inline .control-label { 159 | margin-bottom: 0; 160 | vertical-align: middle; 161 | } 162 | .form-inline .form-control { 163 | display: inline-block; 164 | width: auto; 165 | vertical-align: middle; 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /src/main/resources/static/static/css/main.css: -------------------------------------------------------------------------------- 1 | *{margin:0;padding:0;} 2 | html,body,#app,.wrapper{ 3 | width:100%; 4 | height:100%; 5 | overflow: hidden; 6 | } 7 | body{ 8 | font-family:"Helvetica Neue",Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; 9 | } 10 | a{text-decoration: none} 11 | .content{ 12 | background: none repeat scroll 0 0 #fff; 13 | position: absolute; 14 | left: 250px; 15 | right: 0; 16 | top: 70px; 17 | bottom:0; 18 | width: auto; 19 | padding:40px; 20 | box-sizing: border-box; 21 | overflow-y: scroll; 22 | } 23 | .crumbs{ 24 | margin-bottom: 20px; 25 | } 26 | .pagination{ 27 | margin: 20px 0; 28 | text-align: right; 29 | } 30 | .plugins-tips{ 31 | padding:20px 10px; 32 | margin-bottom: 20px; 33 | } 34 | .el-button+.el-tooltip { 35 | margin-left: 10px; 36 | } 37 | 38 | .el-table tr:hover{ 39 | background: #f6faff; 40 | } 41 | .mgb20{ 42 | margin-bottom: 20px; 43 | } 44 | 45 | .move-enter-active,.move-leave-active{ 46 | transition: opacity .5s; 47 | } 48 | .move-enter,.move-leave{ 49 | opacity: 0; 50 | } 51 | /*BaseForm*/ 52 | .form-box{ 53 | width:600px; 54 | } 55 | .form-box .line{ 56 | text-align: center; 57 | } 58 | .el-time-panel__content::after, .el-time-panel__content::before { 59 | margin-top: -7px; 60 | } 61 | /*Readme*/ 62 | .ms-doc .el-checkbox__input.is-disabled+.el-checkbox__label{ 63 | color: #333; 64 | cursor: pointer; 65 | } 66 | /*Upload*/ 67 | .pure-button{ 68 | width:150px; 69 | height:40px; 70 | line-height: 40px; 71 | text-align: center; 72 | color: #fff; 73 | border-radius: 3px; 74 | } 75 | .g-core-image-corp-container .info-aside{ 76 | height:45px; 77 | } 78 | .el-upload--text { 79 | background-color: #fff; 80 | border: 1px dashed #d9d9d9; 81 | border-radius: 6px; 82 | box-sizing: border-box; 83 | width: 360px; 84 | height: 180px; 85 | text-align: center; 86 | cursor: pointer; 87 | position: relative; 88 | overflow: hidden; 89 | } 90 | .el-upload--text .el-icon-upload { 91 | font-size: 67px; 92 | color: #97a8be; 93 | margin: 40px 0 16px; 94 | line-height: 50px; 95 | } 96 | .el-upload--text { 97 | color: #97a8be; 98 | font-size: 14px; 99 | text-align: center; 100 | } 101 | .el-upload--text em { 102 | font-style: normal; 103 | } 104 | /*VueEditor*/ 105 | .ql-container{ 106 | min-height: 400px; 107 | } 108 | .ql-snow .ql-tooltip{ 109 | transform: translateX(117.5px) translateY(10px) !important; 110 | } 111 | .editor-btn{ 112 | margin-top: 20px; 113 | -------------------------------------------------------------------------------- /src/main/resources/static/static/css/theme-green/color-green.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | background-color: #00d1b2; 3 | } 4 | .login-wrap{ 5 | background: rgba(56, 157, 170, 0.82);; 6 | } 7 | .plugins-tips{ 8 | background: #f2f2f2; 9 | } 10 | .plugins-tips a{ 11 | color: #00d1b2; 12 | } 13 | .el-upload--text em { 14 | color: #00d1b2; 15 | } 16 | .pure-button{ 17 | background: #00d1b2; 18 | } 19 | .vue-datasource .btn-primary { 20 | color: #fff; 21 | background-color: #00d1b2 !important; 22 | border-color: #00d1b2 !important; 23 | } 24 | .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { 25 | background-color: #00d1b2 !important; 26 | border-color: #00d1b2 !important; 27 | -------------------------------------------------------------------------------- /src/main/resources/static/static/css/theme-green/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/css/theme-green/fonts/element-icons.ttf -------------------------------------------------------------------------------- /src/main/resources/static/static/css/theme-green/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/css/theme-green/fonts/element-icons.woff -------------------------------------------------------------------------------- /src/main/resources/static/static/css/theme-green/index.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/css/theme-green/index.css -------------------------------------------------------------------------------- /src/main/resources/static/static/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "pagination": { 3 | "total": 15, 4 | "per_page": 15, 5 | "current_page": 1, 6 | "last_page": 1, 7 | "from": 1, 8 | "to": 15 9 | }, 10 | "data": [ 11 | { 12 | "id": 1, 13 | "name": "Jaylen Schmidt", 14 | "email": "aheaney@example.org", 15 | "city": "Conroyburgh", 16 | "company": "Kunde, Gerhold and Runte", 17 | "job": "Soil Scientist", 18 | "created_at": "2017-01-13 19:17:16", 19 | "updated_at": "2017-01-13 19:17:16" 20 | }, 21 | { 22 | "id": 2, 23 | "name": "Ms. Desiree Franecki III", 24 | "email": "pweissnat@example.net", 25 | "city": "New Mathew", 26 | "company": "Davis Ltd", 27 | "job": "Customer Service Representative", 28 | "created_at": "2017-01-13 19:17:16", 29 | "updated_at": "2017-01-13 19:17:16" 30 | }, 31 | { 32 | "id": 3, 33 | "name": "Clyde Corwin", 34 | "email": "rolfson.lexus@example.com", 35 | "city": "East Ron", 36 | "company": "Zieme and Sons", 37 | "job": "Claims Taker", 38 | "created_at": "2017-01-13 19:17:16", 39 | "updated_at": "2017-01-13 19:17:16" 40 | }, 41 | { 42 | "id": 4, 43 | "name": "Mr. Tyrese Kuphal", 44 | "email": "libby.heaney@example.com", 45 | "city": "Cristianland", 46 | "company": "Abernathy LLC", 47 | "job": "Occupational Health Safety Technician", 48 | "created_at": "2017-01-13 19:17:16", 49 | "updated_at": "2017-01-13 19:17:16" 50 | }, 51 | { 52 | "id": 5, 53 | "name": "Ms. Amya West PhD", 54 | "email": "uheller@example.org", 55 | "city": "Treutelmouth", 56 | "company": "Mraz-Effertz", 57 | "job": "Hazardous Materials Removal Worker", 58 | "created_at": "2017-01-13 19:17:16", 59 | "updated_at": "2017-01-13 19:17:16" 60 | }, 61 | { 62 | "id": 6, 63 | "name": "Murphy Stamm IV", 64 | "email": "ckautzer@example.com", 65 | "city": "Myleneshire", 66 | "company": "Sporer-Wolf", 67 | "job": "Pipelaying Fitter", 68 | "created_at": "2017-01-13 19:17:16", 69 | "updated_at": "2017-01-13 19:17:16" 70 | }, 71 | { 72 | "id": 7, 73 | "name": "Elsa Jast", 74 | "email": "kaitlyn.lang@example.net", 75 | "city": "Mariahstad", 76 | "company": "Hackett LLC", 77 | "job": "Record Clerk", 78 | "created_at": "2017-01-13 19:17:16", 79 | "updated_at": "2017-01-13 19:17:16" 80 | }, 81 | { 82 | "id": 8, 83 | "name": "Hardy Mosciski DVM", 84 | "email": "soledad44@example.net", 85 | "city": "Jasminborough", 86 | "company": "Haley Ltd", 87 | "job": "Kindergarten Teacher", 88 | "created_at": "2017-01-13 19:17:16", 89 | "updated_at": "2017-01-13 19:17:16" 90 | }, 91 | { 92 | "id": 9, 93 | "name": "Demarcus Littel", 94 | "email": "americo84@example.com", 95 | "city": "New Lilaton", 96 | "company": "Satterfield Group", 97 | "job": "Plant Scientist", 98 | "created_at": "2017-01-13 19:17:16", 99 | "updated_at": "2017-01-13 19:17:16" 100 | }, 101 | { 102 | "id": 10, 103 | "name": "Dr. Shad Gleichner", 104 | "email": "eleanora23@example.com", 105 | "city": "Lake Whitneyberg", 106 | "company": "Fay Group", 107 | "job": "Rotary Drill Operator", 108 | "created_at": "2017-01-13 19:17:16", 109 | "updated_at": "2017-01-13 19:17:16" 110 | }, 111 | { 112 | "id": 11, 113 | "name": "Milford Mann", 114 | "email": "shartmann@example.net", 115 | "city": "Lake Austinport", 116 | "company": "Sporer-Langosh", 117 | "job": "Social and Human Service Assistant", 118 | "created_at": "2017-01-13 19:17:16", 119 | "updated_at": "2017-01-13 19:17:16" 120 | }, 121 | { 122 | "id": 12, 123 | "name": "Prof. Mustafa Lindgren Sr.", 124 | "email": "lizeth.morissette@example.net", 125 | "city": "Roweborough", 126 | "company": "Mitchell-Ratke", 127 | "job": "Shoe Machine Operators", 128 | "created_at": "2017-01-13 19:17:16", 129 | "updated_at": "2017-01-13 19:17:16" 130 | }, 131 | { 132 | "id": 13, 133 | "name": "Mrs. Brittany Bode Sr.", 134 | "email": "wiegand.mozelle@example.org", 135 | "city": "South Maxwellville", 136 | "company": "Reilly Inc", 137 | "job": "Bridge Tender OR Lock Tender", 138 | "created_at": "2017-01-13 19:17:16", 139 | "updated_at": "2017-01-13 19:17:16" 140 | }, 141 | { 142 | "id": 14, 143 | "name": "Dariana Bauch", 144 | "email": "dessie.schamberger@example.net", 145 | "city": "East Linnie", 146 | "company": "Wuckert PLC", 147 | "job": "Elementary and Secondary School Administrators", 148 | "created_at": "2017-01-13 19:17:16", 149 | "updated_at": "2017-01-13 19:17:16" 150 | }, 151 | { 152 | "id": 15, 153 | "name": "Jalon Renner", 154 | "email": "lulu45@example.net", 155 | "city": "New Rashad", 156 | "company": "Muller-Kuhn", 157 | "job": "Manufactured Building Installer", 158 | "created_at": "2017-01-13 19:17:16", 159 | "updated_at": "2017-01-13 19:17:16" 160 | } 161 | ] 162 | -------------------------------------------------------------------------------- /src/main/resources/static/static/datasource.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [{ 3 | "id": 1, 4 | "name": "段娜", 5 | "email": "g.rgiuory@kctbut.mw", 6 | "ip": "68.28.4.232" 7 | }, 8 | { 9 | "id": 2, 10 | "name": "蔡洋", 11 | "email": "y.mwjjoje@lpkshev.tg", 12 | "ip": "22.126.12.189" 13 | }, 14 | { 15 | "id": 3, 16 | "name": "陈敏", 17 | "email": "e.voaiiuo@mvng.sn", 18 | "ip": "227.89.13.37" 19 | }, 20 | { 21 | "id": 4, 22 | "name": "朱平", 23 | "email": "e.lduuf@nkfypn.az", 24 | "ip": "9.39.240.243" 25 | }, 26 | { 27 | "id": 5, 28 | "name": "侯平", 29 | "email": "t.czqjyndts@jmwenklns.md", 30 | "ip": "178.162.29.113" 31 | }, 32 | { 33 | "id": 6, 34 | "name": "常超", 35 | "email": "d.dhysgem@uxpcutmlk.tt", 36 | "ip": "192.50.103.170" 37 | }, 38 | { 39 | "id": 7, 40 | "name": "许平", 41 | "email": "g.fiqdonvbc@wanepptw.tv", 42 | "ip": "73.20.99.60" 43 | }, 44 | { 45 | "id": 8, 46 | "name": "毛超", 47 | "email": "w.unyyejh@qus.gt", 48 | "ip": "10.88.135.123" 49 | }, 50 | { 51 | "id": 9, 52 | "name": "周磊", 53 | "email": "e.qbejguqqg@ejpxhltoak.gw", 54 | "ip": "244.221.237.210" 55 | }, 56 | { 57 | "id": 10, 58 | "name": "胡秀英", 59 | "email": "s.dszo@uxaojtj.sy", 60 | "ip": "86.199.17.210" 61 | } 62 | ], 63 | "pagination": { 64 | "total": 15, 65 | "per_page": 15, 66 | "current_page": 1, 67 | "last_page": 1, 68 | "from": 1, 69 | "to": 15 70 | } 71 | -------------------------------------------------------------------------------- /src/main/resources/static/static/fonts/element-icons.b02bdc1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/fonts/element-icons.b02bdc1.ttf -------------------------------------------------------------------------------- /src/main/resources/static/static/img/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/img/img.jpg -------------------------------------------------------------------------------- /src/main/resources/static/static/img/success.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/img/success.jpg -------------------------------------------------------------------------------- /src/main/resources/static/static/img/tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/img/tree.png -------------------------------------------------------------------------------- /src/main/resources/static/static/js/0.b384da680e4e1a5ae82a.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/0.b384da680e4e1a5ae82a.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/1.9c310ee8ce3d29c34f8a.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/1.9c310ee8ce3d29c34f8a.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/10.80057f4ce3fd91455eb1.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/10.80057f4ce3fd91455eb1.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/11.2c57e902036e1bc1f92d.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/11.2c57e902036e1bc1f92d.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/12.32065accb6867acd14ee.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/12.32065accb6867acd14ee.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/2.7d4963d07788a6b5a632.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/2.7d4963d07788a6b5a632.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/3.6f194d0bdcbaca703ede.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/3.6f194d0bdcbaca703ede.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/4.d035e2995ccaa7c8236e.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/4.d035e2995ccaa7c8236e.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/5.c881a9033687cf57ea51.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/5.c881a9033687cf57ea51.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/6.35d822c9c7b7542126a8.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/6.35d822c9c7b7542126a8.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/7.9c34854aa999971653ca.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/7.9c34854aa999971653ca.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/8.23d1f0997c07112908dc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/8.23d1f0997c07112908dc.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/9.792d2c9b22405709d0d3.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/9.792d2c9b22405709d0d3.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/app.59465b2d30e0a9a61f09.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/app.59465b2d30e0a9a61f09.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/manifest.f189ff2d76d27176ffaa.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saysky/petition-system-server/738f2761fb229fcf76a6d12168582b3f1ef23148/src/main/resources/static/static/js/manifest.f189ff2d76d27176ffaa.js -------------------------------------------------------------------------------- /src/main/resources/static/static/js/vendor.f36eef38baace209a2a4.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([13],[function(e,t,n){var i=n(2),r=n(26),o=n(13),s=n(14),a=n(22),l=function(e,t,n){var u,c,d,f,h=e&l.F,p=e&l.G,m=e&l.S,v=e&l.P,g=e&l.B,y=p?i:m?i[t]||(i[t]={}):(i[t]||{}).prototype,b=p?r:r[t]||(r[t]={}),_=b.prototype||(b.prototype={});p&&(n=t);for(u in n)c=!h&&y&&void 0!==y[u],d=(c?y:n)[u],f=g&&c?a(d,i):v&&"function"==typeof d?a(Function.call,d):d,y&&s(y,u,d,e&l.U),b[u]!=d&&o(b,u,f),v&&_[u]!=d&&(_[u]=d)};i.core=r,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){var i=n(4);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var i=n(67)("wks"),r=n(45),o=n(2).Symbol,s="function"==typeof o;(e.exports=function(e){return i[e]||(i[e]=s&&o[e]||(s?o:r)("Symbol."+e))}).store=i},function(e,t,n){e.exports=!n(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var i=n(1),r=n(125),o=n(30),s=Object.defineProperty;t.f=n(6)?Object.defineProperty:function(e,t,n){if(i(e),t=o(t,!0),i(n),r)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var i=n(29),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},function(e,t,n){"use strict";function i(e){if(!e||!e.length)return null;var t={};return e.forEach(function(e){var n=e.field;t[n]=t[n]||[],t[n].push(e)}),t}function r(){for(var e=arguments.length,t=Array(e),n=0;n=o)return e;switch(e){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(e){return"[Circular]"}break;default:return e}}),a=t[i];i"+r+""};e.exports=function(e,t){var n={};n[e]=t(a),i(i.P+i.F*r(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){"use strict";function i(e){return"[object Array]"===C.call(e)}function r(e){return"[object ArrayBuffer]"===C.call(e)}function o(e){return"undefined"!=typeof FormData&&e instanceof FormData}function s(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function a(e){return"string"==typeof e}function l(e){return"number"==typeof e}function u(e){return void 0===e}function c(e){return null!==e&&"object"==typeof e}function d(e){return"[object Date]"===C.call(e)}function f(e){return"[object File]"===C.call(e)}function h(e){return"[object Blob]"===C.call(e)}function p(e){return"[object Function]"===C.call(e)}function m(e){return c(e)&&p(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function g(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function y(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.createElement}function b(e,t){if(null!==e&&void 0!==e)if("object"==typeof e||i(e)||(e=[e]),i(e))for(var n=0,r=e.length;n=0&&Math.floor(t)===t&&isFinite(e)}function f(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function h(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),i=e.split(","),r=0;r-1)return e.splice(n,1)}}function v(e,t){return co.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}function y(e,t){function n(n){var i=arguments.length;return i?i>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function b(e,t){return e.bind(t)}function _(e,t){t=t||0;for(var n=e.length-t,i=new Array(n);n--;)i[n]=e[n+t];return i}function x(e,t){for(var n in t)e[n]=t[n];return e}function w(e){for(var t={},n=0;n-1)if(o&&!v(r,"default"))s=!1;else if(""===s||s===vo(e)){var l=ne(String,r.type);(l<0||a0&&(s=be(s,(t||"")+"_"+n),ye(s[0])&&ye(u)&&(c[l]=O(u.text+s[0].text),s.shift()),c.push.apply(c,s)):a(s)?ye(u)?c[l]=O(u.text+s):""!==s&&c.push(O(s)):ye(s)&&ye(u)?c[l]=O(u.text+s.text):(o(e._isVList)&&r(s.tag)&&i(s.key)&&r(t)&&(s.key="__vlist"+t+"_"+n+"__"),c.push(s)));return c}function _e(e,t){return(e.__esModule||Bo&&"Module"===e[Symbol.toStringTag])&&(e=e.default),l(e)?t.extend(e):e}function xe(e,t,n,i,r){var o=Go();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:i,tag:r},o}function we(e,t,n){if(o(e.error)&&r(e.errorComp))return e.errorComp;if(r(e.resolved))return e.resolved;if(o(e.loading)&&r(e.loadingComp))return e.loadingComp;if(!r(e.contexts)){var s=e.contexts=[n],a=!0,u=function(){for(var e=0,t=s.length;ebs&&ps[n].id>e.id;)n--;ps.splice(n+1,0,e)}else ps.push(e);gs||(gs=!0,le(ze))}}function Ue(e,t,n){ws.get=function(){return this[t][n]},ws.set=function(e){this[t][n]=e},Object.defineProperty(e,n,ws)}function qe(e){e._watchers=[];var t=e.$options;t.props&&Ye(e,t.props),t.methods&&Je(e,t.methods),t.data?Ge(e):F(e._data={},!0),t.computed&&Qe(e,t.computed),t.watch&&t.watch!==Ao&&et(e,t.watch)}function Ye(e,t){var n=e.$options.propsData||{},i=e._props={},r=e.$options._propKeys=[];!e.$parent||P(!1);for(var o in t)!function(o){r.push(o);var s=X(o,t,n,e);R(i,o,s),o in e||Ue(e,"_props",o)}(o);P(!0)}function Ge(e){var t=e.$options.data;t=e._data="function"==typeof t?Ze(t,e):t||{},u(t)||(t={});for(var n=Object.keys(t),i=e.$options.props,r=(e.$options.methods,n.length);r--;){var o=n[r];i&&v(i,o)||T(o)||Ue(e,"_data",o)}F(t,!0)}function Ze(e,t){D();try{return e.call(t,t)}catch(e){return ie(e,t,"data()"),{}}finally{N()}}function Qe(e,t){var n=e._computedWatchers=Object.create(null),i=Ro();for(var r in t){var o=t[r],s="function"==typeof o?o:o.get;i||(n[r]=new xs(e,s||C,C,Cs)),r in e||Ke(e,r,o)}}function Ke(e,t,n){var i=!Ro();"function"==typeof n?(ws.get=i?Xe(t):n,ws.set=C):(ws.get=n.get?i&&!1!==n.cache?Xe(t):n.get:C,ws.set=n.set?n.set:C),Object.defineProperty(e,t,ws)}function Xe(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),Wo.target&&t.depend(),t.value}}function Je(e,t){e.$options.props;for(var n in t)e[n]=null==t[n]?C:go(t[n],e)}function et(e,t){for(var n in t){var i=t[n];if(Array.isArray(i))for(var r=0;r=0||n.indexOf(e[r])<0)&&i.push(e[r]);return i}return e}function At(e){this._init(e)}function Pt(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=_(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}function Lt(e){e.mixin=function(e){return this.options=Q(this.options,e),this}}function jt(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,i=n.cid,r=e._Ctor||(e._Ctor={});if(r[i])return r[i];var o=e.name||n.options.name,s=function(e){this._init(e)};return s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.cid=t++,s.options=Q(n.options,e),s.super=n,s.options.props&&Ft(s),s.options.computed&&Rt(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,xo.forEach(function(e){s[e]=n[e]}),o&&(s.options.components[o]=s),s.superOptions=n.options,s.extendOptions=e,s.sealedOptions=x({},s.options),r[i]=s,s}}function Ft(e){var t=e.options.props;for(var n in t)Ue(e.prototype,"_props",n)}function Rt(e){var t=e.options.computed;for(var n in t)Ke(e.prototype,n,t[n])}function zt(e){xo.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&u(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}function Bt(e){return e&&(e.Ctor.options.name||e.tag)}function Vt(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!c(e)&&e.test(t)}function Ht(e,t){var n=e.cache,i=e.keys,r=e._vnode;for(var o in n){var s=n[o];if(s){var a=Bt(s.componentOptions);a&&!t(a)&&Wt(n,o,i,r)}}}function Wt(e,t,n,i){var r=e[t];!r||i&&r.tag===i.tag||r.componentInstance.$destroy(),e[t]=null,m(n,t)}function Ut(e){for(var t=e.data,n=e,i=e;r(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=qt(i.data,t));for(;r(n=n.parent);)n&&n.data&&(t=qt(t,n.data));return Yt(t.staticClass,t.class)}function qt(e,t){return{staticClass:Gt(e.staticClass,t.staticClass),class:r(e.class)?[e.class,t.class]:t.class}}function Yt(e,t){return r(e)||r(t)?Gt(e,Zt(t)):""}function Gt(e,t){return e?t?e+" "+t:e:t||""}function Zt(e){return Array.isArray(e)?Qt(e):l(e)?Kt(e):"string"==typeof e?e:""}function Qt(e){for(var t,n="",i=0,o=e.length;i-1?ta[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:ta[e]=/HTMLUnknownElement/.test(t.toString())}function en(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function tn(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function nn(e,t){return document.createElementNS(Qs[e],t)}function rn(e){return document.createTextNode(e)}function on(e){return document.createComment(e)}function sn(e,t,n){e.insertBefore(t,n)}function an(e,t){e.removeChild(t)}function ln(e,t){e.appendChild(t)}function un(e){return e.parentNode}function cn(e){return e.nextSibling}function dn(e){return e.tagName}function fn(e,t){e.textContent=t}function hn(e,t){e.setAttribute(t,"")}function pn(e,t){var n=e.data.ref;if(r(n)){var i=e.context,o=e.componentInstance||e.elm,s=i.$refs;t?Array.isArray(s[n])?m(s[n],o):s[n]===o&&(s[n]=void 0):e.data.refInFor?Array.isArray(s[n])?s[n].indexOf(o)<0&&s[n].push(o):s[n]=[o]:s[n]=o}}function mn(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&r(e.data)===r(t.data)&&vn(e,t)||o(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&i(t.asyncFactory.error))}function vn(e,t){if("input"!==e.tag)return!0;var n,i=r(n=e.data)&&r(n=n.attrs)&&n.type,o=r(n=t.data)&&r(n=n.attrs)&&n.type;return i===o||na(i)&&na(o)}function gn(e,t,n){var i,o,s={};for(i=t;i<=n;++i)o=e[i].key,r(o)&&(s[o]=i);return s}function yn(e,t){(e.data.directives||t.data.directives)&&bn(e,t)}function bn(e,t){var n,i,r,o=e===oa,s=t===oa,a=_n(e.data.directives,e.context),l=_n(t.data.directives,t.context),u=[],c=[];for(n in l)i=a[n],r=l[n],i?(r.oldValue=i.value,wn(r,"update",t,e),r.def&&r.def.componentUpdated&&c.push(r)):(wn(r,"bind",t,e),r.def&&r.def.inserted&&u.push(r));if(u.length){var d=function(){for(var n=0;n-1?kn(e,t,n):Us(t)?Zs(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Ws(t)?e.setAttribute(t,Zs(n)||"false"===n?"false":"true"):Ys(t)?Zs(n)?e.removeAttributeNS(qs,Gs(t)):e.setAttributeNS(qs,t,n):kn(e,t,n)}function kn(e,t,n){if(Zs(n))e.removeAttribute(t);else{if($o&&!Do&&"TEXTAREA"===e.tagName&&"placeholder"===t&&!e.__ieph){var i=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",i)};e.addEventListener("input",i),e.__ieph=!0}e.setAttribute(t,n)}}function Sn(e,t){var n=t.elm,o=t.data,s=e.data;if(!(i(o.staticClass)&&i(o.class)&&(i(s)||i(s.staticClass)&&i(s.class)))){var a=Ut(t),l=n._transitionClasses;r(l)&&(a=Gt(a,Zt(l))),a!==n._prevClass&&(n.setAttribute("class",a),n._prevClass=a)}}function Tn(e){function t(){(s||(s=[])).push(e.slice(p,r).trim()),p=r+1}var n,i,r,o,s,a=!1,l=!1,u=!1,c=!1,d=0,f=0,h=0,p=0;for(r=0;r=0&&" "===(v=e.charAt(m));m--);v&&fa.test(v)||(c=!0)}}else void 0===o?(p=r+1,o=e.slice(0,r).trim()):t();if(void 0===o?o=e.slice(0,r).trim():0!==p&&t(),s)for(r=0;r-1?{exp:e.slice(0,Ps),key:'"'+e.slice(Ps+1)+'"'}:{exp:e,key:null};for(Os=e,Ps=Ls=js=0;!Vn();)As=Bn(),Hn(As)?Un(As):91===As&&Wn(As);return{exp:e.slice(0,Ls),key:e.slice(Ls+1,js)}}function Bn(){return Os.charCodeAt(++Ps)}function Vn(){return Ps>=Ns}function Hn(e){return 34===e||39===e}function Wn(e){var t=1;for(Ls=Ps;!Vn();)if(e=Bn(),Hn(e))Un(e);else if(91===e&&t++,93===e&&t--,0===t){js=Ps;break}}function Un(e){for(var t=e;!Vn()&&(e=Bn())!==t;);}function qn(e,t,n){Fs=n;var i=t.value,r=t.modifiers,o=e.tag,s=e.attrsMap.type;if(e.component)return Fn(e,i,r),!1;if("select"===o)Zn(e,i,r);else if("input"===o&&"checkbox"===s)Yn(e,i,r);else if("input"===o&&"radio"===s)Gn(e,i,r);else if("input"===o||"textarea"===o)Qn(e,i,r);else if(!Co.isReservedTag(o))return Fn(e,i,r),!1;return!0}function Yn(e,t,n){var i=n&&n.number,r=Ln(e,"value")||"null",o=Ln(e,"true-value")||"true",s=Ln(e,"false-value")||"false";Dn(e,"checked","Array.isArray("+t+")?_i("+t+","+r+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Pn(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+s+");if(Array.isArray($$a)){var $$v="+(i?"_n("+r+")":r)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Rn(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Rn(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Rn(t,"$$c")+"}",null,!0)}function Gn(e,t,n){var i=n&&n.number,r=Ln(e,"value")||"null";r=i?"_n("+r+")":r,Dn(e,"checked","_q("+t+","+r+")"),Pn(e,"change",Rn(t,r),null,!0)}function Zn(e,t,n){var i=n&&n.number,r='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(i?"_n(val)":"val")+"})",o="var $$selectedVal = "+r+";";o=o+" "+Rn(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),Pn(e,"change",o,null,!0)}function Qn(e,t,n){var i=e.attrsMap.type,r=n||{},o=r.lazy,s=r.number,a=r.trim,l=!o&&"range"!==i,u=o?"change":"range"===i?ha:"input",c="$event.target.value";a&&(c="$event.target.value.trim()"),s&&(c="_n("+c+")");var d=Rn(t,c);l&&(d="if($event.target.composing)return;"+d),Dn(e,"value","("+t+")"),Pn(e,u,d,null,!0),(a||s)&&Pn(e,"blur","$forceUpdate()")}function Kn(e){if(r(e[ha])){var t=$o?"change":"input";e[t]=[].concat(e[ha],e[t]||[]),delete e[ha]}r(e[pa])&&(e.change=[].concat(e[pa],e.change||[]),delete e[pa])}function Xn(e,t,n){var i=Rs;return function r(){null!==e.apply(null,arguments)&&ei(t,r,n,i)}}function Jn(e,t,n,i,r){t=ae(t),n&&(t=Xn(t,e,i)),Rs.addEventListener(e,t,Po?{capture:i,passive:r}:i)}function ei(e,t,n,i){(i||Rs).removeEventListener(e,t._withTask||t,n)}function ti(e,t){if(!i(e.data.on)||!i(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Rs=t.elm,Kn(n),fe(n,r,Jn,ei,t.context),Rs=void 0}}function ni(e,t){if(!i(e.data.domProps)||!i(t.data.domProps)){var n,o,s=t.elm,a=e.data.domProps||{},l=t.data.domProps||{};r(l.__ob__)&&(l=t.data.domProps=x({},l));for(n in a)i(l[n])&&(s[n]="");for(n in l){if(o=l[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),o===a[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n){s._value=o;var u=i(o)?"":String(o);ii(s,u)&&(s.value=u)}else s[n]=o}}}function ii(e,t){return!e.composing&&("OPTION"===e.tagName||ri(e,t)||oi(e,t))}function ri(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}function oi(e,t){var n=e.value,i=e._vModifiers;if(r(i)){if(i.lazy)return!1;if(i.number)return h(n)!==h(t);if(i.trim)return n.trim()!==t.trim()}return n!==t}function si(e){var t=ai(e.style);return e.staticStyle?x(e.staticStyle,t):t}function ai(e){return Array.isArray(e)?w(e):"string"==typeof e?ga(e):e}function li(e,t){var n,i={};if(t)for(var r=e;r.componentInstance;)(r=r.componentInstance._vnode)&&r.data&&(n=si(r.data))&&x(i,n);(n=si(e.data))&&x(i,n);for(var o=e;o=o.parent;)o.data&&(n=si(o.data))&&x(i,n);return i}function ui(e,t){var n=t.data,o=e.data;if(!(i(n.staticStyle)&&i(n.style)&&i(o.staticStyle)&&i(o.style))){var s,a,l=t.elm,u=o.staticStyle,c=o.normalizedStyle||o.style||{},d=u||c,f=ai(t.data.style)||{};t.data.normalizedStyle=r(f.__ob__)?x({},f):f;var h=li(t,!0);for(a in d)i(h[a])&&_a(l,a,"");for(a in h)(s=h[a])!==d[a]&&_a(l,a,null==s?"":s)}}function ci(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function di(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",i=" "+t+" ";n.indexOf(i)>=0;)n=n.replace(i," ");n=n.trim(),n?e.setAttribute("class",n):e.removeAttribute("class")}}function fi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&x(t,Ma(e.name||"v")),x(t,e),t}return"string"==typeof e?Ma(e):void 0}}function hi(e){Na(function(){Na(e)})}function pi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ci(e,t))}function mi(e,t){e._transitionClasses&&m(e._transitionClasses,t),di(e,t)}function vi(e,t,n){var i=gi(e,t),r=i.type,o=i.timeout,s=i.propCount;if(!r)return n();var a=r===Sa?Ia:Da,l=0,u=function(){e.removeEventListener(a,c),n()},c=function(t){t.target===e&&++l>=s&&u()};setTimeout(function(){l0&&(n=Sa,c=s,d=o.length):t===Ta?u>0&&(n=Ta,c=u,d=l.length):(c=Math.max(s,u),n=c>0?s>u?Sa:Ta:null,d=n?n===Sa?o.length:l.length:0),{type:n,timeout:c,propCount:d,hasTransform:n===Sa&&Oa.test(i[Ea+"Property"])}}function yi(e,t){for(;e.length1}function Mi(e,t){!0!==t.data.show&&_i(t)}function ki(e,t,n){Si(e,t,n),($o||No)&&setTimeout(function(){Si(e,t,n)},0)}function Si(e,t,n){var i=t.value,r=e.multiple;if(!r||Array.isArray(i)){for(var o,s,a=0,l=e.options.length;a-1,s.selected!==o&&(s.selected=o);else if(M(Ei(s),i))return void(e.selectedIndex!==a&&(e.selectedIndex=a));r||(e.selectedIndex=-1)}}function Ti(e,t){return t.every(function(t){return!M(t,e)})}function Ei(e){return"_value"in e?e._value:e.value}function Ii(e){e.target.composing=!0}function $i(e){e.target.composing&&(e.target.composing=!1,Di(e.target,"input"))}function Di(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ni(e){return!e.componentInstance||e.data&&e.data.transition?e:Ni(e.componentInstance._vnode)}function Oi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Oi(Me(t.children)):e}function Ai(e){var t={},n=e.$options;for(var i in n.propsData)t[i]=e[i];var r=n._parentListeners;for(var o in r)t[ho(o)]=r[o];return t}function Pi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Li(e){for(;e=e.parent;)if(e.data.transition)return!0}function ji(e,t){return t.key===e.key&&t.tag===e.tag}function Fi(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Ri(e){e.data.newPos=e.elm.getBoundingClientRect()}function zi(e){var t=e.data.pos,n=e.data.newPos,i=t.left-n.left,r=t.top-n.top;if(i||r){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+i+"px,"+r+"px)",o.transitionDuration="0s"}}function Bi(e,t){var n=t?Za(t):Ya;if(n.test(e)){for(var i,r,o,s=[],a=[],l=n.lastIndex=0;i=n.exec(e);){r=i.index,r>l&&(a.push(o=e.slice(l,r)),s.push(JSON.stringify(o)));var u=Tn(i[1].trim());s.push("_s("+u+")"),a.push({"@binding":u}),l=r+i[0].length}return l=0&&s[r].lowerCasedTag!==a;r--);else r=0;if(r>=0){for(var l=s.length-1;l>=r;l--)t.end&&t.end(s[l].tag,n,i);s.length=r,o=r&&s[r-1].tag}else"br"===a?t.start&&t.start(e,[],!0,n,i):"p"===a&&(t.start&&t.start(e,[],!1,n,i),t.end&&t.end(e,n,i))}for(var r,o,s=[],a=t.expectHTML,l=t.isUnaryTag||yo,u=t.canBeLeftOpenTag||yo,c=0;e;){if(r=e,o&&Cl(o)){var d=0,f=o.toLowerCase(),h=Ml[f]||(Ml[f]=new RegExp("([\\s\\S]*?)(]*>)","i")),p=e.replace(h,function(e,n,i){return d=i.length,Cl(f)||"noscript"===f||(n=n.replace(//g,"$1").replace(//g,"$1")),Il(f,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,i(f,c-d,c)}else{var m=e.indexOf("<");if(0===m){if(ul.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v)),n(v+3);continue}}if(cl.test(e)){var g=e.indexOf("]>");if(g>=0){n(g+2);continue}}var y=e.match(ll);if(y){n(y[0].length);continue}var b=e.match(al);if(b){var _=c;n(b[0].length),i(b[1],_,c);continue}var x=function(){var t=e.match(ol);if(t){var i={tagName:t[1],attrs:[],start:c};n(t[0].length);for(var r,o;!(r=e.match(sl))&&(o=e.match(nl));)n(o[0].length),i.attrs.push(o);if(r)return i.unarySlash=r[1],n(r[0].length),i.end=c,i}}();if(x){!function(e){var n=e.tagName,r=e.unarySlash;a&&("p"===o&&tl(n)&&i(o),u(n)&&o===n&&i(n));for(var c=l(n)||!!r,d=e.attrs.length,f=new Array(d),h=0;h=0){for(C=e.slice(m);!(al.test(C)||ol.test(C)||ul.test(C)||cl.test(C)||(M=C.indexOf("<",1))<0);)m+=M,C=e.slice(m);w=e.substring(0,m),n(m)}m<0&&(w=e,e=""),t.chars&&w&&t.chars(w)}if(e===r){t.chars&&t.chars(e);break}}i()}function Gi(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:hr(t),parent:n,children:[]}}function Zi(e,t){function n(e){e.pre&&(a=!1),gl(e.tag)&&(l=!1);for(var n=0;n':'
',wl.innerHTML.indexOf(" ")>0}function oo(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}/*! 2 | * Vue.js v2.5.16 3 | * (c) 2014-2018 Evan You 4 | * Released under the MIT License. 5 | */ 6 | -------------------------------------------------------------------------------- /src/main/resources/static/static/vuetable.json: -------------------------------------------------------------------------------- 1 | { 2 | "list": [{ 3 | "date": "1997-11-11", 4 | "name": "林丽", 5 | "address": "吉林省 辽源市 龙山区" 6 | }, { 7 | "date": "1987-09-24", 8 | "name": "文敏", 9 | "address": "江西省 萍乡市 芦溪县" 10 | }, { 11 | "date": "1996-08-08", 12 | "name": "杨秀兰", 13 | "address": "黑龙江省 黑河市 五大连池市" 14 | }, { 15 | "date": "1978-06-18", 16 | "name": "魏强", 17 | "address": "广东省 韶关市 始兴县" 18 | }, { 19 | "date": "1977-07-09", 20 | "name": "石秀兰", 21 | "address": "江苏省 宿迁市 宿豫区" 22 | }, { 23 | "date": "1994-09-20", 24 | "name": "朱洋", 25 | "address": "海外 海外 -" 26 | }, { 27 | "date": "1980-01-22", 28 | "name": "傅敏", 29 | "address": "海外 海外 -" 30 | }, { 31 | "date": "1985-10-10", 32 | "name": "毛明", 33 | "address": "内蒙古自治区 包头市 九原区" 34 | }, { 35 | "date": "1975-09-08", 36 | "name": "何静", 37 | "address": "西藏自治区 阿里地区 普兰县" 38 | }, { 39 | "date": "1970-06-07", 40 | "name": "郭秀英", 41 | "address": "四川省 巴中市 恩阳区" 42 | }] 43 | -------------------------------------------------------------------------------- /src/test/java/com/example/sens/ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.sens; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | import org.springframework.test.context.junit4.SpringRunner; 6 | 7 | @RunWith(SpringRunner.class) 8 | @SpringBootTest 9 | public class ApplicationTests { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /部署说明.txt: -------------------------------------------------------------------------------- 1 | 数据库版本 5.6+ (支持8.0),jdk1.8+ 2 | 1.创建数据库 petition_system 3 | 2.导入sql 4 | 3.以Maven形式导入项目 5 | 4.注意修改 application.yml 的数据库连接信息、用户名和密码 6 | 5.启动项目,访问 localhost:8080 7 | 6.登录: 8 | 目前数据库有一些账号 9 | 普通员工:zhangsan/123456 10 | 领导:mayun/123456 11 | 其他都是注册用户 12 | 13 | --------------------------------------------------------------------------------