Skip to content

Commit

Permalink
♻️ Refactoring code. 支持 pigx 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
lbw committed Nov 28, 2022
1 parent 13ee1f9 commit ce5cf49
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 109 deletions.
103 changes: 15 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,97 +1,24 @@
<p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.8.1</h1>
<h4 align="center">基于SpringBoot+Vue前后端分离的Java快速开发框架</h4>
<p align="center">
<a href="https://gitee.com/y_project/RuoYi-Vue/stargazers"><img src="https://gitee.com/y_project/RuoYi-Vue/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue"><img src="https://img.shields.io/badge/RuoYi-v3.8.1-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p>
## PIGX 整合前后端分离项目登录

## 平台简介
![](https://minio.pigx.vip/oss/202211/1669615968.jpg)

若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
## 插入客户端

* 前端采用Vue、Element UI。
* 后端采用Spring Boot、Spring Security、Redis & Jwt。
* 权限认证使用Jwt,支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* 高效率开发,使用代码生成器可以一键生成前后端代码。
* 提供了技术栈([Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev))版本[RuoYi-Vue3](https://github.com/yangzongzhuan/RuoYi-Vue3),保持同步更新。
* 提供了单应用版本[RuoYi-Vue-fast](https://github.com/yangzongzhuan/RuoYi-Vue-fast),Oracle版本[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
* 特别鸣谢:[element](https://github.com/ElemeFE/element)[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)[eladmin-web](https://github.com/elunez/eladmin-web)
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)&nbsp;&nbsp;
```sql
INSERT INTO `sys_oauth_client_details` VALUES (10, 'ruoyi', NULL, 'ruoyi', 'server', 'password,refresh_token,authorization_code,client_credentials,mobile', 'http://127.0.0.1:1024/sso', NULL, 0, 0, NULL, 'false', '0', ' ', ' ', NULL, NULL, 1);
```

## 内置功能
## RuoYi 后端信息

1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
3. 岗位管理:配置系统用户所属担任职务。
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
7. 参数管理:对系统动态配置常用参数。
8. 通知公告:系统通知公告信息发布维护。
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
10. 登录日志:系统登录日志记录查询包含登录异常。
11. 在线用户:当前系统中活跃用户状态监控。
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。
14. 系统接口:根据业务代码自动生成相关的api接口文档。
15. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。
16. 缓存监控:对系统的缓存信息查询,命令统计等。
17. 在线构建器:拖动表单元素生成相应的HTML代码。
18. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
> 配置 ② RuoYi 前端地址 默认 1024 端口
> 配置 ③ PIGX 认证中心地址
## 在线体验
![](https://minio.pigx.vip/oss/202211/1669630046.png)

- admin/admin123
- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
## RuoYi 前端配置

演示地址:http://vue.ruoyi.vip
文档地址:http://doc.ruoyi.vip
- 登录页面配置
![](https://minio.pigx.vip/oss/202211/1669630262.png)

## 演示图

<table>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
</tr>
</table>


## 若依前后端分离交流群

QQ群: [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/已满-104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) [![加入QQ群](https://img.shields.io/badge/已满-186866453-blue.svg)](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [![加入QQ群](https://img.shields.io/badge/已满-201396349-blue.svg)](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [![加入QQ群](https://img.shields.io/badge/已满-101456076-blue.svg)](https://jq.qq.com/?_wv=1027&k=kOIINEb5) [![加入QQ群](https://img.shields.io/badge/已满-101539465-blue.svg)](https://jq.qq.com/?_wv=1027&k=UKtX5jhs) [![加入QQ群](https://img.shields.io/badge/已满-264312783-blue.svg)](https://jq.qq.com/?_wv=1027&k=EI9an8lJ) [![加入QQ群](https://img.shields.io/badge/167385320-blue.svg)](https://jq.qq.com/?_wv=1027&k=SWCtLnMz) 点击按钮入群。
- 退出页面配置
![](https://minio.pigx.vip/oss/202211/1669630290.png)
9 changes: 1 addition & 8 deletions ruoyi-admin/src/main/resources/application-druid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://172.27.0.5:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: root
# 从库数据源
Expand Down Expand Up @@ -55,10 +55,3 @@ spring:
wall:
config:
multi-statement-allow: true

sso:
scope: server
client-id: ruoyi
client-secret: ruoyi
callback-url: http://127.0.0.1:1024/sso #业务系统的SSO 登录页面
auth-server: http://127.0.0.1:3000 # pig 认证中心地址
6 changes: 6 additions & 0 deletions ruoyi-admin/src/main/resources/application-sso.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sso:
scope: server
client-id: ruoyi
client-secret: ruoyi
callback-url: http://127.0.0.1:1024/sso #业务系统的SSO 登录页面
auth-server: http://172.27.0.5:3000 # pig 认证中心地址
16 changes: 8 additions & 8 deletions ruoyi-admin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ spring:
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: druid
profiles:
active: druid,sso
# 文件上传
servlet:
multipart:
Expand All @@ -62,13 +62,13 @@ spring:
# redis 配置
redis:
# 地址
host: localhost
host: 172.27.0.5
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password:
password:
# 连接超时时间
timeout: 10s
lettuce:
Expand All @@ -90,7 +90,7 @@ token:
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认30分钟)
expireTime: 30

# MyBatis配置
mybatis:
# 搜索指定包别名
Expand All @@ -101,10 +101,10 @@ mybatis:
configLocation: classpath:mybatis/mybatis-config.xml

# PageHelper分页插件
pagehelper:
pagehelper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
params: count=countSql

# Swagger配置
swagger:
Expand All @@ -114,7 +114,7 @@ swagger:
pathMapping: /dev-api

# 防止XSS攻击
xss:
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ public Authentication authenticate(Authentication authentication) throws Authent

String body = getAccessToken(code);

String accessToken = JSONObject.parseObject(body).getString("access_token");
String username = JSONObject.parseObject(body).getString("username");

String username = JSONObject.parseObject(getSsoUser(accessToken)).getJSONObject("user_info").getString("username");
// 根据code 换username
UserDetails userDetails = userDetailsService.loadUserByUsername(username);

Expand Down Expand Up @@ -81,7 +80,7 @@ public String getAccessToken(String code) {
map.add("redirect_uri", callback);
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers);

ResponseEntity<String> response = new RestTemplate().postForEntity(auth + "/oauth2/token", request, String.class);
ResponseEntity<String> response = new RestTemplate().postForEntity(auth + "/oauth/token", request, String.class);
return response.getBody();
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
Expand Down
2 changes: 1 addition & 1 deletion ruoyi-ui/src/layout/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default {
this.$store.dispatch('LogOut').then(() => {
debugger
location.href = 'http://127.0.0.1:3000/logout?redirect_url=http://127.0.0.1:1024/';
location.href = 'http://172.27.0.5:3000/logout?redirect_url=http://127.0.0.1:1024/';
})
}).catch(() => {});
}
Expand Down
2 changes: 1 addition & 1 deletion ruoyi-ui/src/views/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default {
};
},
handleSSOLogin(){
window.location.href = "http://127.0.0.1:3000/oauth2/authorize?client_id=ruoyi&response_type=code&scope=server&redirect_uri=http://127.0.0.1:1024/sso"
window.location.href = "http://172.27.0.5:3000/oauth/authorize?client_id=ruoyi&response_type=code&scope=server&redirect_uri=http://127.0.0.1:1024/sso"
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
Expand Down

0 comments on commit ce5cf49

Please sign in to comment.