update 优化 三方授权 增加一条默认绑定数据
| | |
| | | |
| | | 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; |
| | |
| | | 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("你还没有绑定第三方账号,绑定后才可以登录!"); |
| | |
| | | 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'); |
| | | |
| | | -- ---------------------------- |
| | | -- 租户表 |
| | |
| | | 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'); |
| | | |
| | | -- ---------------------------- |
| | | -- 租户表 |
| | | -- ---------------------------- |
| | |
| | | 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'); |
| | | |
| | | -- ---------------------------- |
| | | -- 租户表 |
| | | -- ---------------------------- |
| | |
| | | '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 |
| | | ( |
| | |
| | | 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'); |
| | | |
| | | |
| | | -- ---------------------------- |
| | | -- 系统授权表 |
| | | -- ---------------------------- |
| | |
| | | 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'); |
| | | |
| | | |
| | | -- ---------------------------- |
| | | -- 系统授权表 |
| | | -- ---------------------------- |
| | |
| | | '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 |
| | | ( |
| | |
| | | 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'); |
| | | |
| | | -- ---------------------------- |
| | | -- 系统授权表 |
| | | -- ---------------------------- |