Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
barry cho
Ruoyi
Commits
bf370952
Commit
bf370952
authored
3 years ago
by
YunaiV
Browse files
Options
Download
Email Patches
Plain Diff
v.1.5.1 发布,优化多租户功能,支持自动创建用户、角色等信息
parent
e90fc607
master
feature/1.6.1
feature/1.6.2-qcloud
feature/1.6.2-sensitive-word
feature/1.7.0-vue3
feature/bpm-back
feature/flowable
feature/mail-1.6.1
v1.6.1
v1.6.0
v1.5.1
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sql/ruoyi-vue-pro.sql
+14
-9
sql/ruoyi-vue-pro.sql
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java
+8
-3
...yudao/module/system/service/tenant/TenantServiceImpl.java
with
22 additions
and
12 deletions
+22
-12
sql/ruoyi-vue-pro.sql
+
14
-
9
View file @
bf370952
This diff is collapsed.
Click to expand it.
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java
+
8
-
3
View file @
bf370952
...
...
@@ -32,6 +32,7 @@ import cn.iocoder.yudao.module.system.service.tenant.handler.TenantMenuHandler;
import
cn.iocoder.yudao.module.system.service.user.AdminUserService
;
import
lombok.Getter
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
...
...
@@ -80,7 +81,7 @@ public class TenantServiceImpl implements TenantService {
@Getter
private
volatile
Date
maxUpdateTime
;
@
Resource
@
Autowired
(
required
=
false
)
// 由于 yudao.tenant.enable 配置项,可以关闭多租户的功能,所以这里只能不强制注入
private
TenantProperties
tenantProperties
;
@Resource
...
...
@@ -313,7 +314,7 @@ public class TenantServiceImpl implements TenantService {
@Override
public
void
handleTenantInfo
(
TenantInfoHandler
handler
)
{
// 如果禁用,则不执行逻辑
if
(
Boolean
.
FALSE
.
equals
(
tenantProperties
.
getEn
able
())
)
{
if
(
isTenantDis
able
())
{
return
;
}
// 获得租户
...
...
@@ -325,7 +326,7 @@ public class TenantServiceImpl implements TenantService {
@Override
public
void
handleTenantMenu
(
TenantMenuHandler
handler
)
{
// 如果禁用,则不执行逻辑
if
(
Boolean
.
FALSE
.
equals
(
tenantProperties
.
getEn
able
())
)
{
if
(
isTenantDis
able
())
{
return
;
}
// 获得租户,然后获得菜单
...
...
@@ -344,4 +345,8 @@ public class TenantServiceImpl implements TenantService {
return
Objects
.
equals
(
tenant
.
getPackageId
(),
TenantDO
.
PACKAGE_ID_SYSTEM
);
}
private
boolean
isTenantDisable
()
{
return
tenantProperties
==
null
||
Boolean
.
FALSE
.
equals
(
tenantProperties
.
getEnable
());
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help