From 2dd746205354cfab4b4ae6a7c8624bc54b1843fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 13 Jul 2023 17:17:45 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E6=8E=88=E6=9D=83=20=E5=A2=9E=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E6=9D=A1=E9=BB=98=E8=AE=A4=E7=BB=91=E5=AE=9A=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/impl/SocialAuthStrategy.java | 13 +++++++++++++ script/sql/oracle/oracle_ry_vue_5.X.sql | 1 + script/sql/postgres/postgres_ry_vue_5.X.sql | 2 ++ script/sql/ry_vue_5.X.sql | 2 ++ script/sql/sqlserver/sqlserver_ry_vue_5.X.sql | 3 +++ script/sql/update/oracle/update_5.0-5.1.sql | 3 +++ script/sql/update/postgres/update_5.0-5.1.sql | 3 +++ script/sql/update/sqlserver/update_5.0-5.1.sql | 3 +++ script/sql/update/update_5.0-5.1.sql | 2 ++ 9 files changed, 32 insertions(+) diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SocialAuthStrategy.java b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SocialAuthStrategy.java index f71bc9fc..f59babb4 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SocialAuthStrategy.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/SocialAuthStrategy.java @@ -2,8 +2,11 @@ package org.dromara.web.service.impl; import cn.dev33.satoken.stp.SaLoginModel; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import cn.hutool.http.Method; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -68,6 +71,16 @@ public class SocialAuthStrategy implements IAuthStrategy { throw new ServiceException(response.getMsg()); } AuthUser authUserData = response.getData(); + if ("GITEE".equals(authUserData.getSource())) { + // 如用户使用 gitee 登录顺手 star 给作者一点支持 拒绝白嫖 + HttpUtil.createRequest(Method.PUT, "https://gitee.com/api/v5/user/starred/dromara/RuoYi-Vue-Plus") + .formStr(MapUtil.of("access_token", authUserData.getToken().getAccessToken())) + .executeAsync(); + HttpUtil.createRequest(Method.PUT, "https://gitee.com/api/v5/user/starred/dromara/RuoYi-Cloud-Plus") + .formStr(MapUtil.of("access_token", authUserData.getToken().getAccessToken())) + .executeAsync(); + } + SysSocialVo social = sysSocialService.selectByAuthId(authUserData.getSource() + authUserData.getUuid()); if (!ObjectUtil.isNotNull(social)) { throw new ServiceException("你还没有绑定第三方账号,绑定后才可以登录!"); diff --git a/script/sql/oracle/oracle_ry_vue_5.X.sql b/script/sql/oracle/oracle_ry_vue_5.X.sql index 25c855ad..83ca8268 100644 --- a/script/sql/oracle/oracle_ry_vue_5.X.sql +++ b/script/sql/oracle/oracle_ry_vue_5.X.sql @@ -67,6 +67,7 @@ comment on column sys_social.update_by is '更新者'; comment on column sys_social.update_time is '更新时间'; comment on column sys_social.del_flag is '删除标志(0代表存在 2代表删除)'; +insert into sys_social values (1, 1, '000000', 'GITEE1766278', 'GITEE', NULL, 'JavaLionLi', '', '', 'https://foruda.gitee.com/avatar/1676987709652631782/1766278_javalionli_1585201115.png', '2a25b8a8b6803939070d931cdb1f9540', 86400, '448155d0a9c35e6a036a346f7a090f9b3aa7fd41fd2e9563e71e38a7faffbe1c', NULL, NULL, 'user_info projects', 'bearer', NULL, NULL, NULL, NULL, NULL, NULL, 103, 1, '2023-07-13 17:12:01', 1, '2023-07-13 17:12:01', '0'); -- ---------------------------- -- 租户表 diff --git a/script/sql/postgres/postgres_ry_vue_5.X.sql b/script/sql/postgres/postgres_ry_vue_5.X.sql index d2f39f06..194c497f 100644 --- a/script/sql/postgres/postgres_ry_vue_5.X.sql +++ b/script/sql/postgres/postgres_ry_vue_5.X.sql @@ -66,6 +66,8 @@ comment on column sys_social.update_by is '更新者'; comment on column sys_social.update_time is '更新时间'; comment on column sys_social.del_flag is '删除标志(0代表存在 2代表删除)'; +insert into sys_social values (1, 1, '000000', 'GITEE1766278', 'GITEE', NULL, 'JavaLionLi', '', '', 'https://foruda.gitee.com/avatar/1676987709652631782/1766278_javalionli_1585201115.png', '2a25b8a8b6803939070d931cdb1f9540', 86400, '448155d0a9c35e6a036a346f7a090f9b3aa7fd41fd2e9563e71e38a7faffbe1c', NULL, NULL, 'user_info projects', 'bearer', NULL, NULL, NULL, NULL, NULL, NULL, 103, 1, '2023-07-13 17:12:01', 1, '2023-07-13 17:12:01', '0'); + -- ---------------------------- -- 租户表 -- ---------------------------- diff --git a/script/sql/ry_vue_5.X.sql b/script/sql/ry_vue_5.X.sql index 1ff22050..96beb455 100644 --- a/script/sql/ry_vue_5.X.sql +++ b/script/sql/ry_vue_5.X.sql @@ -36,6 +36,8 @@ create table sys_social PRIMARY KEY (id) ) engine=innodb comment = '社会化关系表'; +INSERT INTO sys_social VALUES (1, 1, '000000', 'GITEE1766278', 'GITEE', NULL, 'JavaLionLi', '', '', 'https://foruda.gitee.com/avatar/1676987709652631782/1766278_javalionli_1585201115.png', '2a25b8a8b6803939070d931cdb1f9540', 86400, '448155d0a9c35e6a036a346f7a090f9b3aa7fd41fd2e9563e71e38a7faffbe1c', NULL, NULL, 'user_info projects', 'bearer', NULL, NULL, NULL, NULL, NULL, NULL, 103, 1, '2023-07-13 17:12:01', 1, '2023-07-13 17:12:01', '0'); + -- ---------------------------- -- 租户表 -- ---------------------------- diff --git a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql index 193a14a2..4d99790e 100644 --- a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql +++ b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql @@ -211,6 +211,9 @@ EXEC sys.sp_addextendedproperty 'COLUMN', N'update_time' GO +INSERT sys_social VALUES (1, 1, N'000000', N'GITEE1766278', N'GITEE', NULL, N'JavaLionLi', N'', N'', N'https://foruda.gitee.com/avatar/1676987709652631782/1766278_javalionli_1585201115.png', N'2a25b8a8b6803939070d931cdb1f9540', 86400, N'448155d0a9c35e6a036a346f7a090f9b3aa7fd41fd2e9563e71e38a7faffbe1c', NULL, NULL, N'user_info projects', N'bearer', NULL, NULL, NULL, NULL, NULL, NULL, 103, 1, N'2023-07-13 17:12:01', 1, N'2023-07-13 17:12:01', N'0'); +GO + CREATE TABLE sys_tenant ( diff --git a/script/sql/update/oracle/update_5.0-5.1.sql b/script/sql/update/oracle/update_5.0-5.1.sql index 5ebca2c3..a0d4643c 100644 --- a/script/sql/update/oracle/update_5.0-5.1.sql +++ b/script/sql/update/oracle/update_5.0-5.1.sql @@ -73,6 +73,9 @@ comment on column sys_social.update_by is '更新者'; comment on column sys_social.update_time is '更新时间'; comment on column sys_social.del_flag is '删除标志(0代表存在 2代表删除)'; +insert into sys_social values (1, 1, '000000', 'GITEE1766278', 'GITEE', NULL, 'JavaLionLi', '', '', 'https://foruda.gitee.com/avatar/1676987709652631782/1766278_javalionli_1585201115.png', '2a25b8a8b6803939070d931cdb1f9540', 86400, '448155d0a9c35e6a036a346f7a090f9b3aa7fd41fd2e9563e71e38a7faffbe1c', NULL, NULL, 'user_info projects', 'bearer', NULL, NULL, NULL, NULL, NULL, NULL, 103, 1, '2023-07-13 17:12:01', 1, '2023-07-13 17:12:01', '0'); + + -- ---------------------------- -- 系统授权表 -- ---------------------------- diff --git a/script/sql/update/postgres/update_5.0-5.1.sql b/script/sql/update/postgres/update_5.0-5.1.sql index c98b5a74..df0df7f5 100644 --- a/script/sql/update/postgres/update_5.0-5.1.sql +++ b/script/sql/update/postgres/update_5.0-5.1.sql @@ -72,6 +72,9 @@ comment on column sys_social.update_by is '更新者'; comment on column sys_social.update_time is '更新时间'; comment on column sys_social.del_flag is '删除标志(0代表存在 2代表删除)'; +insert into sys_social values (1, 1, '000000', 'GITEE1766278', 'GITEE', NULL, 'JavaLionLi', '', '', 'https://foruda.gitee.com/avatar/1676987709652631782/1766278_javalionli_1585201115.png', '2a25b8a8b6803939070d931cdb1f9540', 86400, '448155d0a9c35e6a036a346f7a090f9b3aa7fd41fd2e9563e71e38a7faffbe1c', NULL, NULL, 'user_info projects', 'bearer', NULL, NULL, NULL, NULL, NULL, NULL, 103, 1, '2023-07-13 17:12:01', 1, '2023-07-13 17:12:01', '0'); + + -- ---------------------------- -- 系统授权表 -- ---------------------------- diff --git a/script/sql/update/sqlserver/update_5.0-5.1.sql b/script/sql/update/sqlserver/update_5.0-5.1.sql index 6bbedcf3..7f8e0951 100644 --- a/script/sql/update/sqlserver/update_5.0-5.1.sql +++ b/script/sql/update/sqlserver/update_5.0-5.1.sql @@ -224,6 +224,9 @@ EXEC sys.sp_addextendedproperty 'COLUMN', N'update_time' GO +INSERT sys_social VALUES (1, 1, N'000000', N'GITEE1766278', N'GITEE', NULL, N'JavaLionLi', N'', N'', N'https://foruda.gitee.com/avatar/1676987709652631782/1766278_javalionli_1585201115.png', N'2a25b8a8b6803939070d931cdb1f9540', 86400, N'448155d0a9c35e6a036a346f7a090f9b3aa7fd41fd2e9563e71e38a7faffbe1c', NULL, NULL, N'user_info projects', N'bearer', NULL, NULL, NULL, NULL, NULL, NULL, 103, 1, N'2023-07-13 17:12:01', 1, N'2023-07-13 17:12:01', N'0'); +GO + CREATE TABLE sys_client ( diff --git a/script/sql/update/update_5.0-5.1.sql b/script/sql/update/update_5.0-5.1.sql index 1fa78d7e..a9e724c7 100644 --- a/script/sql/update/update_5.0-5.1.sql +++ b/script/sql/update/update_5.0-5.1.sql @@ -40,6 +40,8 @@ create table sys_social PRIMARY KEY (id) ) engine=innodb comment = '社会化关系表'; +insert into sys_social values (1, 1, '000000', 'GITEE1766278', 'GITEE', NULL, 'JavaLionLi', '', '', 'https://foruda.gitee.com/avatar/1676987709652631782/1766278_javalionli_1585201115.png', '2a25b8a8b6803939070d931cdb1f9540', 86400, '448155d0a9c35e6a036a346f7a090f9b3aa7fd41fd2e9563e71e38a7faffbe1c', NULL, NULL, 'user_info projects', 'bearer', NULL, NULL, NULL, NULL, NULL, NULL, 103, 1, '2023-07-13 17:12:01', 1, '2023-07-13 17:12:01', '0'); + -- ---------------------------- -- 系统授权表 -- ----------------------------