Commit bab327c3 authored by wangjinjing's avatar wangjinjing

建金发布版本

parent 3920b9e0
MIT License
Copyright (c) 2019 赵俊
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Shiro-Action
[![Build Status](https://travis-ci.org/zhaojun1998/Shiro-Action.svg?branch=master)](https://travis-ci.org/zhaojun1998/Shiro-Action)
![https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square](https://img.shields.io/badge/license-MIT-blue.svg?longCache=true&style=flat-square)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3b39480c887b42f1875c0210817b500f)](https://www.codacy.com/app/zhaojun1998/Shiro-Action?utm_source=github.com&utm_medium=referral&utm_content=zhaojun1998/Shiro-Action&utm_campaign=Badge_Grade)
![https://img.shields.io/badge/springboot-2.0.6-orange.svg?style=flat-square](https://img.shields.io/badge/springboot-2.0.6-yellow.svg?longCache=true&style=popout-square)
![https://img.shields.io/badge/apache%20shiro-1.4.0-green.svg?style=flat-square](https://img.shields.io/badge/apache%20shiro-1.4.0-green.svg?longCache=true&style=flat-square)
![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/zhaojun1998/Shiro-Action.svg?style=flat-square)
本项目使用 Spring Boot 搭建, 用于加深对 Spring Boot 与 Shiro 的学习, 项目特色是支持 restful 风格权限控制, 支持对同一 URL, 不同 HTTP Mehtod 的权限控制, 适用于更多的场景.
预览地址: [http://shiro.jun6.net/](http://shiro.jun6.net/)
文档地址: [http://docs.zhaojun.im/shiro/](http://docs.zhaojun.im/shiro/)
默认管理员账号: `admin`, 密码: `123456`.
普通用户账号: `user`, 密码: `123456`.
> 为了不影响其他人的浏览体验, 请尽量不要进行删除类的敏感操作. `admin` 为超级管理员, 自动拥有全部权限.
## 系统特色
* 支持根据同 URL, 不同 HTTP Method 来校验权限, 更支持 restful 场景.
* 集成 OAuth2 登录, 且提供了接口易于拓展开发.
* 全局异常处理. 根据请求方式区分返回 json 数据还是错误页面.
* Logback MDC 支持, 将当前登录人和操作者 IP 加入日志中.
* JSR-303 数据校验
## 运行环境
* JDK 1.8
* MySQL 5.7
* Redis
## 快速开始
### 下载项目
```git
git clone https://github.com/zhaojun1998/Shiro-Action.git
```
### 导入项目
使用自己的 IDE 导入, Eclipse 和 Intellij IDEA 均可.
### 导入数据库
创建数据库, 字符集选择 `utf8`, 排序规则选择 `utf8_general_ci`.
然后导入 `shiro_action.sql` 到数据库中.
### 配置文件
打开 `application.properties` 修改 `MySQL``Redis` 连接信息.
```properties
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.cache.type=redis
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/shiro_action?useSSL=false&characterEncoding=UTF8
```
### 启动项目
在完成了上述步骤后,找到 ShiroActionApplication 启动类, 启动即可.
启动后访问地址为:http://localhost:8080 , 用户名:admin, 密码:123456.
## 系统预览
![](https://cdn.jun6.net/201905292303_211.png)
![](https://cdn.jun6.net/201906302159_326.png)
![](https://cdn.jun6.net/2019/06/30/5d18c0a85b38a.png)
![](https://cdn.jun6.net/2019/06/30/5d18c0a849285.png)
![](https://cdn.jun6.net/2019/06/30/5d18c1e09d314.png)
![](https://cdn.jun6.net/2019/06/30/5d18c1ad27580.png)
![](https://cdn.jun6.net/2019/06/30/5d18c1ad29d05.png)
### 技术选型
#### 前端
* 前端框架: [Layui](https://www.layui.com/)
* 后台模板: [Z-Admin](https://github.com/zhaojun1998/Z-Admin/)
#### 后端
* SpringBoot 2.0.6.RELEASE
* Shiro 1.4.0
* MyBatis 1.3.2
* Druid 1.1.10
* PageHelper 1.2.9
* Shiro-Redis 3.2.3
#### 其他工具类
* OAuth2 认证工具类: [JustAuth](https://gitee.com/yadong.zhang/JustAuth)
* Hutool : [https://hutool.cn/](https://hutool.cn/)
### 反馈交流
QQ 群号: [850586205](//shang.qq.com/wpa/qunwpa?idkey=b482b2e48a938a993ef54adcff7ed499a45127a73802a68f1238256fb02ed425)
![](https://cdn.jun6.net/201904141340_574.png)
......@@ -14,7 +14,7 @@ datasource.druid.validationQuery=SELECT 'x' FROM DUAL
# 格式为:ip地址:端口:用户名:密码
# 端口号一定要写,例如:192.168.2.100:21:reader:reader
ftp.host=33.65.219.103:21:hzjt:1qaz2wsx
ftp.host=33.65.250.179:21:hzjt:1qaz2wsx
alarm.subscribe.data.key=gs:traff:alarmlist
......@@ -39,6 +39,6 @@ gs.traff.cloud.department.fileagent.url=http://33.50.1.22:8888/agent/fileAgent?f
alarmrecord.check.push.recordtype=1
eventsend.url=http://33.65.219.103:8089/sendEvents
devicesend.url=http://33.65.219.103:8089/traffdevicewriteresult/sendDevices
eventsend.url=http://33.65.250.179:8089/sendEvents
devicesend.url=http://33.65.250.179:8089/traffdevicewriteresult/sendDevices
devicesend.timeout=1000
\ No newline at end of file
/*
Navicat Premium Data Transfer
Source Server : 本机
Source Server Type : MySQL
Source Server Version : 50721
Source Host : localhost:3306
Source Schema : shiro_action
Target Server Type : MySQL
Target Server Version : 50721
File Encoding : 65001
Date: 05/06/2019 21:26:43
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for dept
-- ----------------------------
DROP TABLE IF EXISTS `dept`;
CREATE TABLE `dept` (
`dept_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '部门ID',
`dept_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '部门名称',
`parent_id` int(11) NOT NULL COMMENT '上级部门ID',
`order_num` int(11) NULL DEFAULT NULL COMMENT '排序',
`create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`modify_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
PRIMARY KEY (`dept_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of dept
-- ----------------------------
INSERT INTO dept VALUES (1, '开发部', 0, 1, '2019-03-17 16:15:02', '2019-03-31 19:05:00');
INSERT INTO dept VALUES (2, '测试部', 0, 2, '2019-03-17 16:15:06', '2019-03-31 18:53:47');
INSERT INTO dept VALUES (3, '运维部', 0, 3, '2019-03-17 16:15:12', '2019-03-31 19:04:50');
INSERT INTO dept VALUES (4, '开发一组', 1, 4, '2019-03-17 16:15:23', '2019-03-31 18:53:47');
INSERT INTO dept VALUES (5, '开发二组', 1, 5, '2019-03-17 16:15:27', '2019-03-31 18:53:47');
INSERT INTO dept VALUES (6, '测试一组', 2, 6, '2019-03-17 16:22:20', '2019-03-31 18:53:47');
INSERT INTO dept VALUES (7, '测试二组', 2, 7, '2019-03-17 16:22:25', '2019-03-31 18:53:47');
INSERT INTO dept VALUES (8, '运维一组', 3, 8, '2019-03-17 16:22:41', '2019-03-31 18:53:47');
INSERT INTO dept VALUES (9, '运维二组', 3, 9, '2019-03-17 16:22:44', '2019-03-31 18:53:47');
INSERT INTO dept VALUES (10, '运维三组', 3, 10, '2019-03-17 16:22:47', '2019-03-31 18:53:47');
-- ----------------------------
-- Table structure for login_log
-- ----------------------------
DROP TABLE IF EXISTS `login_log`;
CREATE TABLE `login_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`login_time` datetime(0) NULL DEFAULT NULL COMMENT '登录时间',
`username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
`login_status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录状态, 0 表示登录失败, 1 表示登录成功.',
`ip` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'IP',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 393 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '登录日志表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
`menu_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '菜单 ID',
`parent_id` int(11) NOT NULL,
`menu_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单名称',
`url` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单 URL',
`perms` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限标识符',
`order_num` int(11) NULL DEFAULT NULL COMMENT '排序',
`create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`modify_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
`icon` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',
PRIMARY KEY (`menu_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 31 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of menu
-- ----------------------------
INSERT INTO menu VALUES (1, 0, '权限管理', '#', '#', 0, '2018-12-02 07:51:17', '2019-05-08 20:20:05', 'layui-icon-picker-securityscan');
INSERT INTO menu VALUES (2, 1, '用户管理', '/user/index', 'user:list', 1, '2018-12-23 19:50:25', '2019-05-06 21:20:18', 'layui-icon-username');
INSERT INTO menu VALUES (3, 1, '角色管理', '/role/index', 'role:list', 2, '2018-12-02 07:51:18', '2019-05-06 21:20:27', 'layui-icon-group');
INSERT INTO menu VALUES (4, 1, '菜单权限', '/menu/index', 'menu:list', 3, '2019-02-07 10:57:06', '2019-05-06 21:21:24', 'layui-icon-list');
INSERT INTO menu VALUES (11, 0, '系统监控', '#', '#', 5, '2019-02-04 15:07:41', '2019-05-08 20:25:01', 'layui-icon-picker-control');
INSERT INTO menu VALUES (12, 11, '登录日志', '/log/login/index', 'login:log:list', 1, '2018-12-09 10:07:36', '2019-02-10 22:27:00', NULL);
INSERT INTO menu VALUES (19, 11, '操作日志', '/log/sys/index', 'sys:log:list', 4, '2018-12-22 22:48:27', '2019-02-10 22:12:13', NULL);
INSERT INTO menu VALUES (20, 11, '在线用户', '/online/index', 'user:online', 3, '2018-12-23 15:40:21', '2019-02-10 22:27:00', NULL);
INSERT INTO menu VALUES (27, 1, '操作权限', '/operator/index', 'operator:list', 4, '2019-02-10 17:39:08', '2019-02-16 19:49:22', NULL);
INSERT INTO menu VALUES (28, 1, '部门管理', '/dept/index', 'dept:list', 6, '2019-03-13 20:58:55', NULL, NULL);
INSERT INTO menu VALUES (29, 11, '系统管理', '/system/index', 'system:index', 7, '2019-04-27 23:06:08', NULL, NULL);
INSERT INTO menu VALUES (30, 0, '账号关联', '/oauth2/index', 'oauth2:index', 8, '2019-05-12 21:16:23', '2019-05-26 20:40:08', 'layui-icon-picker-insertrowabove');
-- ----------------------------
-- Table structure for operator
-- ----------------------------
DROP TABLE IF EXISTS `operator`;
CREATE TABLE `operator` (
`operator_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '菜单 ID',
`menu_id` int(11) NOT NULL COMMENT '所属菜单 ID',
`operator_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源名称',
`url` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源 URL',
`perms` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限标识符',
`http_method` varchar(7) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源需要的 HTTP 请求方法',
`create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`modify_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
PRIMARY KEY (`operator_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of operator
-- ----------------------------
INSERT INTO `operator` VALUES (1, 2, '删除用户', '/user/*', 'user:delete', 'DELETE', '2019-03-03 16:12:27', '2019-03-03 16:12:50');
INSERT INTO `operator` VALUES (2, 2, '添加用户', '/user', 'user:add', 'POST', '2019-02-19 22:21:17', NULL);
INSERT INTO `operator` VALUES (3, 2, '授予角色', '/user/*/allocation', 'user:allocation', 'POST', '2019-03-03 16:03:37', '2019-03-03 16:06:59');
INSERT INTO `operator` VALUES (4, 2, '重置密码', '/user/*/reset', 'user:reset', 'POST', '2019-03-10 14:51:58', NULL);
INSERT INTO `operator` VALUES (5, 3, '新增角色', '/role', 'role:add', 'POST', '2019-03-03 16:07:48', NULL);
INSERT INTO `operator` VALUES (6, 3, '删除角色', '/role/*', 'role:delete', 'DELETE', '2019-03-03 16:08:39', NULL);
INSERT INTO `operator` VALUES (7, 3, '授予菜单', '/role/*/grant/menu', 'role:grant:menu', 'POST', '2019-03-03 16:09:13', '2019-03-03 16:17:48');
INSERT INTO `operator` VALUES (8, 3, '授予功能', '/role/*/grant/operator', 'role:grant:operator', 'POST', '2019-03-03 16:12:09', '2019-03-03 16:17:48');
INSERT INTO `operator` VALUES (9, 3, '修改角色', '/role', 'role:update', 'PUT', '2019-03-03 16:27:02', '2019-03-31 18:25:14');
INSERT INTO `operator` VALUES (10, 4, '新增菜单', '/menu', 'menu:add', 'POST', '2019-03-03 16:29:22', NULL);
INSERT INTO `operator` VALUES (11, 4, '修改菜单', '/menu', 'menu:update', 'PUT', '2019-03-03 16:30:59', '2019-03-31 18:24:46');
INSERT INTO `operator` VALUES (12, 4, '删除菜单', '/menu/*', 'menu:delete', 'DELETE', '2019-03-03 16:31:32', '2019-03-31 18:24:55');
INSERT INTO `operator` VALUES (13, 27, '新增操作点', '/operator', 'operator:add', 'POST', '2019-03-03 16:47:35', NULL);
INSERT INTO `operator` VALUES (14, 27, '删除操作点', '/operator', 'operator:delete', 'DELETE', '2019-03-03 16:47:45', NULL);
INSERT INTO `operator` VALUES (15, 27, '修改操作点', '/operator', 'operator:update', 'PUT', '2019-03-03 16:48:01', '2019-03-31 18:26:24');
INSERT INTO `operator` VALUES (16, 28, '新增部门', '/dept', 'dept:add', 'POST', '2019-03-31 18:21:23', NULL);
INSERT INTO `operator` VALUES (17, 28, '删除部门', '/dept/*', 'dept:delete', 'DELETE', '2019-03-31 18:21:38', NULL);
INSERT INTO `operator` VALUES (18, 2, '修改用户', '/user', 'user:update', 'PUT', '2019-03-31 18:22:33', '2019-03-31 18:24:26');
INSERT INTO `operator` VALUES (19, 28, '修改部门', '/dept', 'dept:update', 'PUT', '2019-03-31 18:24:11', '2019-03-31 18:24:18');
INSERT INTO `operator` VALUES (20, 20, '踢出用户', '/online/kickout', 'online:kickout', 'POST', '2019-06-05 20:52:41', NULL);
-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`role_id` int(11) NOT NULL AUTO_INCREMENT,
`role_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`modify_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
PRIMARY KEY (`role_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES (1, '管理员', '这是一个管理员', '2018-12-02 07:47:40', '2018-12-02 07:47:45');
INSERT INTO `role` VALUES (2, '普通用户', '这是一个普通用户', '2018-12-02 10:09:08', '2019-06-05 20:50:41');
-- ----------------------------
-- Table structure for role_menu
-- ----------------------------
DROP TABLE IF EXISTS `role_menu`;
CREATE TABLE `role_menu` (
`role_id` int(11) NOT NULL,
`menu_id` int(11) NOT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of role_menu
-- ----------------------------
INSERT INTO `role_menu` VALUES (1, 1);
INSERT INTO `role_menu` VALUES (1, 2);
INSERT INTO `role_menu` VALUES (1, 3);
INSERT INTO `role_menu` VALUES (1, 4);
INSERT INTO `role_menu` VALUES (1, 27);
INSERT INTO `role_menu` VALUES (1, 28);
INSERT INTO `role_menu` VALUES (1, 11);
INSERT INTO `role_menu` VALUES (1, 12);
INSERT INTO `role_menu` VALUES (1, 20);
INSERT INTO `role_menu` VALUES (1, 19);
INSERT INTO `role_menu` VALUES (1, 29);
INSERT INTO `role_menu` VALUES (1, 30);
INSERT INTO `role_menu` VALUES (2, 1);
INSERT INTO `role_menu` VALUES (2, 2);
INSERT INTO `role_menu` VALUES (2, 3);
INSERT INTO `role_menu` VALUES (2, 4);
INSERT INTO `role_menu` VALUES (2, 27);
INSERT INTO `role_menu` VALUES (2, 28);
INSERT INTO `role_menu` VALUES (2, 11);
INSERT INTO `role_menu` VALUES (2, 12);
INSERT INTO `role_menu` VALUES (2, 20);
INSERT INTO `role_menu` VALUES (2, 19);
INSERT INTO `role_menu` VALUES (2, 29);
INSERT INTO `role_menu` VALUES (2, 30);
-- ----------------------------
-- Table structure for role_operator
-- ----------------------------
DROP TABLE IF EXISTS `role_operator`;
CREATE TABLE `role_operator` (
`role_id` int(11) NULL DEFAULT NULL,
`operator_id` int(11) NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色-操作关系表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of role_operator
-- ----------------------------
INSERT INTO `role_operator` VALUES (1, 1);
INSERT INTO `role_operator` VALUES (1, 2);
INSERT INTO `role_operator` VALUES (1, 3);
INSERT INTO `role_operator` VALUES (1, 4);
INSERT INTO `role_operator` VALUES (1, 18);
INSERT INTO `role_operator` VALUES (1, 5);
INSERT INTO `role_operator` VALUES (1, 6);
INSERT INTO `role_operator` VALUES (1, 7);
INSERT INTO `role_operator` VALUES (1, 8);
INSERT INTO `role_operator` VALUES (1, 9);
INSERT INTO `role_operator` VALUES (1, 10);
INSERT INTO `role_operator` VALUES (1, 11);
INSERT INTO `role_operator` VALUES (1, 12);
INSERT INTO `role_operator` VALUES (1, 13);
INSERT INTO `role_operator` VALUES (1, 14);
INSERT INTO `role_operator` VALUES (1, 15);
INSERT INTO `role_operator` VALUES (1, 16);
INSERT INTO `role_operator` VALUES (1, 17);
INSERT INTO `role_operator` VALUES (1, 19);
INSERT INTO `role_operator` VALUES (2, 2);
INSERT INTO `role_operator` VALUES (2, 3);
INSERT INTO `role_operator` VALUES (2, 4);
INSERT INTO `role_operator` VALUES (2, 18);
INSERT INTO `role_operator` VALUES (2, 5);
INSERT INTO `role_operator` VALUES (2, 7);
INSERT INTO `role_operator` VALUES (2, 8);
INSERT INTO `role_operator` VALUES (2, 9);
INSERT INTO `role_operator` VALUES (2, 10);
INSERT INTO `role_operator` VALUES (2, 11);
INSERT INTO `role_operator` VALUES (2, 13);
INSERT INTO `role_operator` VALUES (2, 15);
INSERT INTO `role_operator` VALUES (2, 16);
INSERT INTO `role_operator` VALUES (2, 19);
-- ----------------------------
-- Table structure for sys_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
`operation` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作',
`time` int(11) NULL DEFAULT NULL COMMENT '响应时间/耗时',
`method` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求方法',
`params` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求参数',
`ip` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'IP',
`create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '操作日志表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
`password` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',
`salt` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '盐',
`email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`status` int(1) NULL DEFAULT NULL COMMENT '账号状态: 0: 未激活, 1: 已激活. ',
`last_login_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '最后登录时间',
`create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`modify_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
`active_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '注册激活码',
`dept_id` int(11) NULL DEFAULT NULL COMMENT '部门ID',
PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, 'admin', 'f51703256a38e6bab3d9410a070c32ea', 'salt', 'root@zhaojun.im', 1, '2019-06-05 21:19:16', '2018-12-02 07:30:52', '2019-06-05 21:19:16', NULL, 1);
INSERT INTO `user` VALUES (2, 'user', 'e0f68781b7887b2210715b88c96d15d9', '1559739026345', 'user@qq.com', 1, '2019-06-05 21:24:23', '2019-06-05 20:50:26', '2019-06-05 21:24:23', NULL, 1);
-- ----------------------------
-- Table structure for user_auths
-- ----------------------------
DROP TABLE IF EXISTS `user_auths`;
CREATE TABLE `user_auths` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(11) NULL DEFAULT NULL COMMENT '用户 ID',
`identity_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录类型',
`identifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '第三方登录的用户名',
`credential` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '第三方登录 token',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
`user_id` int(11) NOT NULL,
`role_id` int(11) NOT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of user_role
-- ----------------------------
INSERT INTO `user_role` VALUES (1, 1);
INSERT INTO `user_role` VALUES (1, 2);
INSERT INTO `user_role` VALUES (2, 2);
SET FOREIGN_KEY_CHECKS = 1;
SELECT A.FDID,
CHANNELID,
to_char(A.RECORDTIME, 'yyyy-MM-DD') countdate,
count(*) totalcount,
recordtype eventtype,
areaid,
b.tdmc,
(select C.NAME
from T_CODE C
where C.KEY = UPPER(RECORDTYPE)
and rownum = 1) eventtypename,
(SELECT DEPT_NAME
FROM Dept d
where d.dept_id = a.areaid
and rownum = 1) areaname,
sum(case
when pushstatus is null or pushstatus = 9 then
1
else
0
end) nopush,
sum(case
when pushstatus = 0 then
1
else
0
end) successpush,
sum(case
when pushstatus = 1 then
1
else
0
end) failpush
FROM TRAFFALARMRECORD A, sbtdspsr b
where B.SBBH = A.FDID
and B.TDBH = CHANNELID
group by to_char(A.RECORDTIME, 'yyyy-MM-DD'),
recordtype,
A.FDID,
CHANNELID,
b.tdmc,
areaid;
......@@ -210,7 +210,7 @@ public class LoginController {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
HttpEntity<String> requestEntity = new HttpEntity<>(message, headers);
return restTemplate.postForObject("http://33.65.219.103:" + 8089 + "/alarmevent", requestEntity, ResultObj.class);
return restTemplate.postForObject("http://33.65.250.179:" + 8089 + "/alarmevent", requestEntity, ResultObj.class);
}
......
......@@ -2,12 +2,12 @@ spring.profiles.active=dev
server.port=8082
spring.datasource.username=hzjt
spring.datasource.password=hzjt
spring.datasource.url=jdbc:oracle:thin:@33.65.219.103:1521:helowin
#spring.datasource.username=test
#spring.datasource.password=test
#spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:3306:helowin
#spring.datasource.username=hzjt
#spring.datasource.password=hzjt
#spring.datasource.url=jdbc:oracle:thin:@33.65.250.179:1521:helowin
spring.datasource.username=test
spring.datasource.password=test
spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1523:helowin
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
# ��ʼ����С����С�����
......@@ -29,8 +29,8 @@ spring.datasource.useGlobalDataSourceStat=true
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8
#
#spring.redis.host=localhost
spring.redis.host=33.65.219.103
spring.redis.host=localhost
#spring.redis.host=33.65.250.179
spring.redis.port=6379
spring.cache.type=redis
spring.cache.redis.time-to-live=600000
......@@ -67,9 +67,9 @@ spring.devtools.restart.exclude=static/**,public/**
managername=admin
devicesend.url=http://33.65.219.103:8089/traffdevicewriteresult/sendDevices
devicesend.url=http://33.65.250.179:8089/traffdevicewriteresult/sendDevices
devicesend.timeout=1000
flvurl=http://33.65.219.103:8089/getflv
flvurl=http://33.65.250.179:8089/getflv
json.resisurl=http://33.50.1.21:57081/record/ecvs
qingzhi.devicewrite.url=http://33.50.1.213:38080/api/jtldpt/impld/deviceWrite
......@@ -78,8 +78,8 @@ qingzhi.devicewrite.timeout=5000
qingzhi.eventwrite.url=http://33.50.1.213:38080/api/jtldpt/impld/trafficEventWrite
qingzhi.eventwrite.timeout=5000
eventsend.url=http://33.65.219.103:8089/sendEvents
pushrecordurl=33.65.219.103:8089/sendtouser
eventsend.url=http://33.65.250.179:8089/sendEvents
pushrecordurl=33.65.250.179:8089/sendtouser
ipstrs=33.55.1.85,33.55.1.86,33.55.1.87,33.55.1.88,33.55.1.89,33.55.1.90,33.55.1.91,33.55.1.92,33.55.1.93,33.55.1.94,33.55.1.95,33.55.1.96,33.51.6.97,33.60.1.7,33.54.3.240,33.53.1.171,33.52.1.222,33.61.1.23,33.57.1.22
ipurl=:8001/api/traffic-incident/restartAutoRule
\ No newline at end of file
......@@ -1249,7 +1249,7 @@ let arr_right_s = [];
//websocket连接
let d = new Date().getTime();
let web_ip = "ws:/33.65.219.103:8089/websocket/" + d;
let web_ip = "ws:/33.65.250.179:8089/websocket/" + d;
let wss = new WebSocket(web_ip);
wss.onopen = function () {
console.log("连接成功");
......@@ -1532,7 +1532,7 @@ $('[name="status"]').bootstrapSwitch({
//推送近5分钟数据
function websocket_s(ds) {
let web_ips = "ws:/33.65.219.103:8089/websocket/" + ds;
let web_ips = "ws:/33.65.250.179:8089/websocket/" + ds;
ws_j5fz = new WebSocket(web_ips);
ws_j5fz.onopen = function () {
console.log("连接成功");
......@@ -1582,7 +1582,7 @@ function websocket_s(ds) {
//推送自动规则
function websocket_gzdj(video_id, items, indexs_1) {
let web_ips = "ws:/33.65.219.103:8089/websocket/" + video_id;
let web_ips = "ws:/33.65.250.179:8089/websocket/" + video_id;
let ws_gzdj = new WebSocket(web_ips);
ws_gzdj.onopen = function () {
console.log("连接成功");
......
......@@ -1249,7 +1249,7 @@ let arr_right_s = [];
//websocket连接
let d = new Date().getTime();
let web_ip = "ws:/33.65.219.103:8089/websocket/" + d;
let web_ip = "ws:/33.65.250.179:8089/websocket/" + d;
let wss = new WebSocket(web_ip);
wss.onopen = function () {
console.log("连接成功");
......@@ -1520,7 +1520,7 @@ $('[name="status"]').bootstrapSwitch({
//推送近5分钟数据
function websocket_s(ds) {
let web_ips = "ws:/33.65.219.103:8089/websocket/" + ds;
let web_ips = "ws:/33.65.250.179:8089/websocket/" + ds;
ws_j5fz = new WebSocket(web_ips);
ws_j5fz.onopen = function () {
console.log("连接成功");
......@@ -1570,7 +1570,7 @@ function websocket_s(ds) {
//推送自动规则
function websocket_gzdj(video_id, items, indexs_1) {
let web_ips = "ws:/33.65.219.103:8089/websocket/" + video_id;
let web_ips = "ws:/33.65.250.179:8089/websocket/" + video_id;
let ws_gzdj = new WebSocket(web_ips);
ws_gzdj.onopen = function () {
console.log("连接成功");
......
......@@ -617,7 +617,7 @@ $('[data-gallery=manual]').click(function (e) {
new PhotoViewer(items, options);
});
let d = new Date().getTime();
let web_ip = "ws:/33.65.219.103:8089/websocket/" + d;
let web_ip = "ws:/33.65.250.179:8089/websocket/" + d;
let wss = new WebSocket(web_ip);
wss.onopen = function () {
console.log("连接成功");
......
......@@ -673,7 +673,7 @@ $('[data-gallery=manual]').click(function (e) {
let d = new Date().getTime();
let web_ip = "ws:/33.65.219.103:8089/websocket/" + d;
let web_ip = "ws:/33.65.250.179:8089/websocket/" + d;
let wss = new WebSocket(web_ip);
wss.onopen = function () {
console.log("连接成功");
......@@ -751,7 +751,6 @@ wss.onmessage = function (evt) {
vue_sjsstxnow.yjsj_data = [];
vue_sjsstxnow.ejsj_data = [];
vue_sjsstxnow.sjsj_data = [];
$("#myModal_sjcx").modal("show");
$("#myModal_sjcx").find('input').each(function () {
$(this).removeAttr("checked", false);
......@@ -793,9 +792,11 @@ wss.onmessage = function (evt) {
vue_sjcx.query(1, true);
}, 200);
});
$("#myModal_sjcx").modal("show");
//播放声音
let myMp3 = document.getElementById("audio");
audio.play();
// audio.play();
}
}
}
......
......@@ -685,7 +685,7 @@ $('[data-gallery=manual]').click(function (e) {
new PhotoViewer(items, options);
});
let d = new Date().getTime();
let web_ip = "ws:/33.65.219.103:8089/websocket/" + d;
let web_ip = "ws:/33.65.250.179:8089/websocket/" + d;
let wss = new WebSocket(web_ip);
wss.onopen = function () {
console.log("连接成功");
......@@ -752,13 +752,12 @@ wss.onmessage = function (evt) {
});
//右边消息弹出框的id
let tss = 'a' + data.data.ts;
//判断三级弹出框是否已经弹出,没有弹出,则清空,若是弹出,则继续push
//判断三级弹出框是否已经弹出,没有弹出,则清空,若是弹出,则继续push
if ($("#myModal_sjcx")[0].style.display != 'block') {
$(".carousel").collapse();
vue_sjsstxnow.yjsj_data = [];
vue_sjsstxnow.ejsj_data = [];
vue_sjsstxnow.sjsj_data = [];
$("#myModal_sjcx").modal("show");
$("#myModal_sjcx").find('input').each(function () {
$(this).removeAttr("checked", false);
......@@ -864,6 +863,9 @@ wss.onmessage = function (evt) {
vue_sjcx.query(1, true);
}, 500);
}
$("#myModal_sjcx").modal("show");
new NoticeJs({
text: 'Notification message',
position: 'bottomRight',
......
......@@ -705,7 +705,7 @@ laydate.render({
}
});
function websocket_s(d) {
let web_ip = "ws:/33.65.219.103:8089/websocket/" + d;
let web_ip = "ws:/33.65.250.179:8089/websocket/" + d;
wss = new WebSocket(web_ip);
wss.onopen = function () {
console.log("连接成功");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment