Skip to content

Commit 3ae45f9

Browse files
committed
feat: add login API
1 parent 66db562 commit 3ae45f9

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
drop table if exists `t_permission_role`;
2+
3+
create table `t_permission_role`
4+
(
5+
`id` int not null auto_increment comment '主键id',
6+
`name` varchar(255) not null comment '名称',
7+
`description` varchar(2000) comment '描述',
8+
`created_by` varchar(60) not null comment '创建人',
9+
`created_time` timestamp not null default current_timestamp comment '创建时间',
10+
`last_updated_by` varchar(60) not null comment '最后修改人',
11+
`last_updated_time` timestamp not null default current_timestamp comment '更新时间',
12+
primary key (`id`) using btree,
13+
unique index `u_idx_permission_role` (`name`) using btree
14+
) engine = innodb comment = '';
15+
16+
drop table if exists `t_auth_usesr_units_roles`;
17+
18+
create table `t_auth_users_units_roles`
19+
(
20+
`id` int not null auto_increment comment '主键id',
21+
`user_id` int not null comment '用户',
22+
`unit_id` int not null comment '业务单元',
23+
`unit_type` int not null comment '业务单元类型',
24+
`tenant_id` int not null comment '组织id',
25+
`role_id` int not null comment '角色id',
26+
`expired_time` timestamp comment '过期时间',
27+
`created_by` varchar(60) not null comment '创建人',
28+
`created_time` timestamp not null default current_timestamp comment '创建时间',
29+
`last_updated_by` varchar(60) not null comment '最后修改人',
30+
`last_updated_time` timestamp not null default current_timestamp comment '更新时间',
31+
primary key (`id`) using btree,
32+
unique index `u_idx_auth_users_units_roles` (`user_id`, `unit_id`, `unit_type`) using btree
33+
) engine = innodb comment = '';

base/src/main/java/com/tinyengine/it/login/config/context/DefaultLoginUserContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public String getRenterId() {
3333
@Override
3434
public int getPlatformId() {
3535
UserInfo userInfo = currentUser.get();
36-
return userInfo != null ? userInfo.getPlatformId() : 0;
36+
return userInfo != null ? userInfo.getPlatformId() : 1;
3737
}
3838

3939
@Override

0 commit comments

Comments
 (0)