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
This diff is collapsed.
......@@ -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