Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
f631fc98
Unverified
提交
f631fc98
authored
4月 02, 2022
作者:
fit2cloudrd
提交者:
GitHub
4月 02, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 新建仪表板卡顿问题
Co-authored-by:
wangjiahao
<
1522128093@qq.com
>
上级
4b42e738
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
146 行增加
和
82 行删除
+146
-82
ExtSysAuthMapper.java
...in/java/io/dataease/base/mapper/ext/ExtSysAuthMapper.java
+2
-2
ExtSysAuthMapper.xml
...ain/java/io/dataease/base/mapper/ext/ExtSysAuthMapper.xml
+4
-0
SysAuthConstants.java
.../java/io/dataease/commons/constants/SysAuthConstants.java
+16
-0
DataSetGroupService.java
...java/io/dataease/service/dataset/DataSetGroupService.java
+3
-0
DataSetTableService.java
...java/io/dataease/service/dataset/DataSetTableService.java
+7
-0
DatasourceService.java
...ava/io/dataease/service/datasource/DatasourceService.java
+5
-0
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+8
-11
SysAuthService.java
...src/main/java/io/dataease/service/sys/SysAuthService.java
+5
-0
V33__1.9.sql
backend/src/main/resources/db/migration/V33__1.9.sql
+96
-69
没有找到文件。
backend/src/main/java/io/dataease/base/mapper/ext/ExtSysAuthMapper.java
浏览文件 @
f631fc98
...
@@ -5,8 +5,8 @@ import org.apache.ibatis.annotations.Param;
...
@@ -5,8 +5,8 @@ import org.apache.ibatis.annotations.Param;
public
interface
ExtSysAuthMapper
{
public
interface
ExtSysAuthMapper
{
Boolean
checkTreeNoManageCount
(
@Param
(
"userId"
)
Long
userId
,
@Param
(
"modelType"
)
String
modelType
,
@Param
(
"nodeId"
)
String
nodeId
);
Boolean
checkTreeNoManageCount
(
@Param
(
"userId"
)
Long
userId
,
@Param
(
"modelType"
)
String
modelType
,
@Param
(
"nodeId"
)
String
nodeId
);
String
copyAuth
(
@Param
(
"authSource"
)
String
authSource
,
@Param
(
"authSourceType"
)
String
authSourceType
,
@Param
(
"authUser"
)
String
authUser
);
}
}
backend/src/main/java/io/dataease/base/mapper/ext/ExtSysAuthMapper.xml
浏览文件 @
f631fc98
...
@@ -14,4 +14,8 @@
...
@@ -14,4 +14,8 @@
select if(CHECK_TREE_NO_MANAGE_PRIVILEGE(#{userId},#{modelType},#{nodeId})>0,1,0)
select if(CHECK_TREE_NO_MANAGE_PRIVILEGE(#{userId},#{modelType},#{nodeId})>0,1,0)
</select>
</select>
<select
id=
"copyAuth"
resultType=
"String"
>
select copy_auth(#{authSource},#{authSourceType},#{authUser})
</select>
</mapper>
</mapper>
backend/src/main/java/io/dataease/commons/constants/SysAuthConstants.java
0 → 100644
浏览文件 @
f631fc98
package
io
.
dataease
.
commons
.
constants
;
/**
* Author: wangjiahao
* Date: 2022/4/2
* Description:
*/
public
class
SysAuthConstants
{
public
final
static
String
AUTH_SOURCE_TYPE_PANEL
=
"panel"
;
public
final
static
String
AUTH_SOURCE_TYPE_DATASET
=
"dataset"
;
public
final
static
String
AUTH_SOURCE_TYPE_DATASOURCE
=
"link"
;
}
backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java
浏览文件 @
f631fc98
...
@@ -7,6 +7,7 @@ import io.dataease.base.mapper.DatasetGroupMapper;
...
@@ -7,6 +7,7 @@ import io.dataease.base.mapper.DatasetGroupMapper;
import
io.dataease.base.mapper.ext.ExtDataSetGroupMapper
;
import
io.dataease.base.mapper.ext.ExtDataSetGroupMapper
;
import
io.dataease.commons.constants.AuthConstants
;
import
io.dataease.commons.constants.AuthConstants
;
import
io.dataease.commons.constants.DePermissionType
;
import
io.dataease.commons.constants.DePermissionType
;
import
io.dataease.commons.constants.SysAuthConstants
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.commons.utils.TreeUtils
;
import
io.dataease.commons.utils.TreeUtils
;
...
@@ -54,8 +55,10 @@ public class DataSetGroupService {
...
@@ -54,8 +55,10 @@ public class DataSetGroupService {
datasetGroup
.
setCreateBy
(
AuthUtils
.
getUser
().
getUsername
());
datasetGroup
.
setCreateBy
(
AuthUtils
.
getUser
().
getUsername
());
datasetGroup
.
setCreateTime
(
System
.
currentTimeMillis
());
datasetGroup
.
setCreateTime
(
System
.
currentTimeMillis
());
datasetGroupMapper
.
insert
(
datasetGroup
);
datasetGroupMapper
.
insert
(
datasetGroup
);
String
userName
=
AuthUtils
.
getUser
().
getUsername
();
// 清理权限缓存
// 清理权限缓存
CacheUtils
.
removeAll
(
AuthConstants
.
USER_PERMISSION_CACHE_NAME
);
CacheUtils
.
removeAll
(
AuthConstants
.
USER_PERMISSION_CACHE_NAME
);
sysAuthService
.
copyAuth
(
datasetGroup
.
getId
(),
SysAuthConstants
.
AUTH_SOURCE_TYPE_DATASET
);
}
else
{
}
else
{
datasetGroupMapper
.
updateByPrimaryKeySelective
(
datasetGroup
);
datasetGroupMapper
.
updateByPrimaryKeySelective
(
datasetGroup
);
}
}
...
...
backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java
浏览文件 @
f631fc98
...
@@ -33,6 +33,7 @@ import io.dataease.provider.datasource.JdbcProvider;
...
@@ -33,6 +33,7 @@ import io.dataease.provider.datasource.JdbcProvider;
import
io.dataease.provider.DDLProvider
;
import
io.dataease.provider.DDLProvider
;
import
io.dataease.provider.QueryProvider
;
import
io.dataease.provider.QueryProvider
;
import
io.dataease.service.engine.EngineService
;
import
io.dataease.service.engine.EngineService
;
import
io.dataease.service.sys.SysAuthService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -102,6 +103,8 @@ public class DataSetTableService {
...
@@ -102,6 +103,8 @@ public class DataSetTableService {
private
PermissionService
permissionService
;
private
PermissionService
permissionService
;
@Resource
@Resource
private
EngineService
engineService
;
private
EngineService
engineService
;
@Resource
private
SysAuthService
sysAuthService
;
private
static
boolean
isUpdatingDatasetTableStatus
=
false
;
private
static
boolean
isUpdatingDatasetTableStatus
=
false
;
private
static
final
String
lastUpdateTime
=
"${__last_update_time__}"
;
private
static
final
String
lastUpdateTime
=
"${__last_update_time__}"
;
...
@@ -261,6 +264,10 @@ public class DataSetTableService {
...
@@ -261,6 +264,10 @@ public class DataSetTableService {
datasetTable
.
setCreateBy
(
AuthUtils
.
getUser
().
getUsername
());
datasetTable
.
setCreateBy
(
AuthUtils
.
getUser
().
getUsername
());
datasetTable
.
setCreateTime
(
System
.
currentTimeMillis
());
datasetTable
.
setCreateTime
(
System
.
currentTimeMillis
());
int
insert
=
datasetTableMapper
.
insert
(
datasetTable
);
int
insert
=
datasetTableMapper
.
insert
(
datasetTable
);
// 清理权限缓存
CacheUtils
.
removeAll
(
AuthConstants
.
USER_PERMISSION_CACHE_NAME
);
sysAuthService
.
copyAuth
(
datasetTable
.
getId
(),
SysAuthConstants
.
AUTH_SOURCE_TYPE_DATASET
);
// 添加表成功后,获取当前表字段和类型,抽象到dataease数据库
// 添加表成功后,获取当前表字段和类型,抽象到dataease数据库
if
(
insert
==
1
)
{
if
(
insert
==
1
)
{
saveTableField
(
datasetTable
);
saveTableField
(
datasetTable
);
...
...
backend/src/main/java/io/dataease/service/datasource/DatasourceService.java
浏览文件 @
f631fc98
...
@@ -11,6 +11,7 @@ import io.dataease.base.mapper.DatasourceMapper;
...
@@ -11,6 +11,7 @@ import io.dataease.base.mapper.DatasourceMapper;
import
io.dataease.base.mapper.ext.ExtDataSourceMapper
;
import
io.dataease.base.mapper.ext.ExtDataSourceMapper
;
import
io.dataease.base.mapper.ext.query.GridExample
;
import
io.dataease.base.mapper.ext.query.GridExample
;
import
io.dataease.commons.constants.DePermissionType
;
import
io.dataease.commons.constants.DePermissionType
;
import
io.dataease.commons.constants.SysAuthConstants
;
import
io.dataease.commons.exception.DEException
;
import
io.dataease.commons.exception.DEException
;
import
io.dataease.commons.model.AuthURD
;
import
io.dataease.commons.model.AuthURD
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.AuthUtils
;
...
@@ -34,6 +35,7 @@ import io.dataease.provider.datasource.ApiProvider;
...
@@ -34,6 +35,7 @@ import io.dataease.provider.datasource.ApiProvider;
import
io.dataease.provider.datasource.DatasourceProvider
;
import
io.dataease.provider.datasource.DatasourceProvider
;
import
io.dataease.service.dataset.DataSetGroupService
;
import
io.dataease.service.dataset.DataSetGroupService
;
import
io.dataease.service.message.DeMsgutil
;
import
io.dataease.service.message.DeMsgutil
;
import
io.dataease.service.sys.SysAuthService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -57,6 +59,8 @@ public class DatasourceService {
...
@@ -57,6 +59,8 @@ public class DatasourceService {
private
DataSetGroupService
dataSetGroupService
;
private
DataSetGroupService
dataSetGroupService
;
@Resource
@Resource
private
CommonThreadPool
commonThreadPool
;
private
CommonThreadPool
commonThreadPool
;
@Resource
private
SysAuthService
sysAuthService
;
private
static
List
<
String
>
dsTypes
=
Arrays
.
asList
(
"TiDB"
,
"StarRocks"
,
"excel"
,
"mysql"
,
"hive"
,
"impala"
,
"mariadb"
,
"ds_doris"
,
"pg"
,
"sqlServer"
,
"oracle"
,
"mongo"
,
"ck"
,
"db2"
,
"es"
,
"redshift"
,
"api"
);
private
static
List
<
String
>
dsTypes
=
Arrays
.
asList
(
"TiDB"
,
"StarRocks"
,
"excel"
,
"mysql"
,
"hive"
,
"impala"
,
"mariadb"
,
"ds_doris"
,
"pg"
,
"sqlServer"
,
"oracle"
,
"mongo"
,
"ck"
,
"db2"
,
"es"
,
"redshift"
,
"api"
);
@DeCleaner
(
DePermissionType
.
DATASOURCE
)
@DeCleaner
(
DePermissionType
.
DATASOURCE
)
...
@@ -73,6 +77,7 @@ public class DatasourceService {
...
@@ -73,6 +77,7 @@ public class DatasourceService {
checkAndUpdateDatasourceStatus
(
datasource
);
checkAndUpdateDatasourceStatus
(
datasource
);
datasourceMapper
.
insertSelective
(
datasource
);
datasourceMapper
.
insertSelective
(
datasource
);
handleConnectionPool
(
datasource
,
"add"
);
handleConnectionPool
(
datasource
,
"add"
);
sysAuthService
.
copyAuth
(
datasource
.
getId
(),
SysAuthConstants
.
AUTH_SOURCE_TYPE_DATASOURCE
);
return
datasource
;
return
datasource
;
}
}
...
...
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
f631fc98
...
@@ -6,10 +6,7 @@ import io.dataease.auth.annotation.DeCleaner;
...
@@ -6,10 +6,7 @@ import io.dataease.auth.annotation.DeCleaner;
import
io.dataease.base.domain.*
;
import
io.dataease.base.domain.*
;
import
io.dataease.base.mapper.*
;
import
io.dataease.base.mapper.*
;
import
io.dataease.base.mapper.ext.*
;
import
io.dataease.base.mapper.ext.*
;
import
io.dataease.commons.constants.AuthConstants
;
import
io.dataease.commons.constants.*
;
import
io.dataease.commons.constants.CommonConstants
;
import
io.dataease.commons.constants.DePermissionType
;
import
io.dataease.commons.constants.PanelConstants
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.commons.utils.TreeUtils
;
import
io.dataease.commons.utils.TreeUtils
;
...
@@ -31,6 +28,7 @@ import io.dataease.service.dataset.DataSetTableService;
...
@@ -31,6 +28,7 @@ import io.dataease.service.dataset.DataSetTableService;
import
io.dataease.service.sys.SysAuthService
;
import
io.dataease.service.sys.SysAuthService
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.pentaho.di.core.util.UUIDUtil
;
import
org.pentaho.di.core.util.UUIDUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -94,7 +92,6 @@ public class PanelGroupService {
...
@@ -94,7 +92,6 @@ public class PanelGroupService {
@Resource
@Resource
private
ExtPanelGroupExtendDataMapper
extPanelGroupExtendDataMapper
;
private
ExtPanelGroupExtendDataMapper
extPanelGroupExtendDataMapper
;
public
List
<
PanelGroupDTO
>
tree
(
PanelGroupRequest
panelGroupRequest
)
{
public
List
<
PanelGroupDTO
>
tree
(
PanelGroupRequest
panelGroupRequest
)
{
String
userId
=
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
());
String
userId
=
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
());
panelGroupRequest
.
setUserId
(
userId
);
panelGroupRequest
.
setUserId
(
userId
);
...
@@ -110,22 +107,21 @@ public class PanelGroupService {
...
@@ -110,22 +107,21 @@ public class PanelGroupService {
}
}
@DeCleaner
(
DePermissionType
.
PANEL
)
@DeCleaner
(
DePermissionType
.
PANEL
)
// @Transactional
public
PanelGroup
saveOrUpdate
(
PanelGroupRequest
request
)
{
public
PanelGroup
saveOrUpdate
(
PanelGroupRequest
request
)
{
String
userName
=
AuthUtils
.
getUser
().
getUsername
();
String
panelId
=
request
.
getId
();
String
panelId
=
request
.
getId
();
if
(
StringUtils
.
isNotEmpty
(
panelId
)){
if
(
StringUtils
.
isNotEmpty
(
panelId
)){
panelViewService
.
syncPanelViews
(
request
);
panelViewService
.
syncPanelViews
(
request
);
}
}
if
(
StringUtils
.
isEmpty
(
panelId
))
{
if
(
StringUtils
.
isEmpty
(
panelId
))
{
// 新建
// 新建
checkPanelName
(
request
.
getName
(),
request
.
getPid
(),
PanelConstants
.
OPT_TYPE_INSERT
,
null
,
request
.
getNodeType
());
checkPanelName
(
request
.
getName
(),
request
.
getPid
(),
PanelConstants
.
OPT_TYPE_INSERT
,
null
,
request
.
getNodeType
());
panelId
=
newPanel
(
request
);
panelId
=
newPanel
(
request
);
panelGroupMapper
.
insert
(
request
);
panelGroupMapper
.
insert
(
request
);
// 清理权限缓存
// 清理权限缓存
clearPermissionCache
();
clearPermissionCache
();
}
else
if
(
"toDefaultPanel"
.
equals
(
request
.
getOptType
()))
{
sysAuthService
.
copyAuth
(
panelId
,
SysAuthConstants
.
AUTH_SOURCE_TYPE_PANEL
);
}
else
if
(
"toDefaultPanel"
.
equals
(
request
.
getOptType
()))
{
// 转存为默认仪表板
panelId
=
UUID
.
randomUUID
().
toString
();
panelId
=
UUID
.
randomUUID
().
toString
();
// 转存为默认仪表板
PanelGroupWithBLOBs
newDefaultPanel
=
panelGroupMapper
.
selectByPrimaryKey
(
request
.
getId
());
PanelGroupWithBLOBs
newDefaultPanel
=
panelGroupMapper
.
selectByPrimaryKey
(
request
.
getId
());
newDefaultPanel
.
setPanelType
(
PanelConstants
.
PANEL_TYPE_SYSTEM
);
newDefaultPanel
.
setPanelType
(
PanelConstants
.
PANEL_TYPE_SYSTEM
);
newDefaultPanel
.
setNodeType
(
PanelConstants
.
PANEL_NODE_TYPE_PANEL
);
newDefaultPanel
.
setNodeType
(
PanelConstants
.
PANEL_NODE_TYPE_PANEL
);
...
@@ -139,10 +135,12 @@ public class PanelGroupService {
...
@@ -139,10 +135,12 @@ public class PanelGroupService {
panelGroupMapper
.
insertSelective
(
newDefaultPanel
);
panelGroupMapper
.
insertSelective
(
newDefaultPanel
);
// 清理权限缓存
// 清理权限缓存
clearPermissionCache
();
clearPermissionCache
();
sysAuthService
.
copyAuth
(
panelId
,
SysAuthConstants
.
AUTH_SOURCE_TYPE_PANEL
);
}
else
if
(
"copy"
.
equals
(
request
.
getOptType
()))
{
}
else
if
(
"copy"
.
equals
(
request
.
getOptType
()))
{
panelId
=
this
.
panelGroupCopy
(
request
,
null
,
true
);
panelId
=
this
.
panelGroupCopy
(
request
,
null
,
true
);
// 清理权限缓存
// 清理权限缓存
clearPermissionCache
();
clearPermissionCache
();
sysAuthService
.
copyAuth
(
panelId
,
SysAuthConstants
.
AUTH_SOURCE_TYPE_PANEL
);
}
else
if
(
"move"
.
equals
(
request
.
getOptType
()))
{
}
else
if
(
"move"
.
equals
(
request
.
getOptType
()))
{
PanelGroupWithBLOBs
panelInfo
=
panelGroupMapper
.
selectByPrimaryKey
(
request
.
getId
());
PanelGroupWithBLOBs
panelInfo
=
panelGroupMapper
.
selectByPrimaryKey
(
request
.
getId
());
if
(
panelInfo
.
getPid
().
equalsIgnoreCase
(
request
.
getPid
()))
{
if
(
panelInfo
.
getPid
().
equalsIgnoreCase
(
request
.
getPid
()))
{
...
@@ -447,5 +445,4 @@ public class PanelGroupService {
...
@@ -447,5 +445,4 @@ public class PanelGroupService {
CacheUtils
.
removeAll
(
AuthConstants
.
DEPT_PANEL_NAME
);
CacheUtils
.
removeAll
(
AuthConstants
.
DEPT_PANEL_NAME
);
}
}
}
}
backend/src/main/java/io/dataease/service/sys/SysAuthService.java
浏览文件 @
f631fc98
...
@@ -20,4 +20,9 @@ public class SysAuthService {
...
@@ -20,4 +20,9 @@ public class SysAuthService {
}
}
}
}
public
void
copyAuth
(
String
authSource
,
String
authSourceType
){
String
userName
=
AuthUtils
.
getUser
().
getUsername
();
extSysAuthMapper
.
copyAuth
(
authSource
,
authSourceType
,
userName
);
}
}
}
backend/src/main/resources/db/migration/V33__1.9.sql
浏览文件 @
f631fc98
...
@@ -101,9 +101,7 @@ ADD COLUMN `copy_from` varchar(255) NULL COMMENT '复制来源' AFTER `update_ti
...
@@ -101,9 +101,7 @@ ADD COLUMN `copy_from` varchar(255) NULL COMMENT '复制来源' AFTER `update_ti
ADD
COLUMN
`copy_id`
varchar
(
255
)
NULL
COMMENT
'复制ID'
AFTER
`copy_from`
;
ADD
COLUMN
`copy_id`
varchar
(
255
)
NULL
COMMENT
'复制ID'
AFTER
`copy_from`
;
-- ----------------------------
-- Function structure for copy_auth
-- ----------------------------
DROP
FUNCTION
IF
EXISTS
`copy_auth`
;
DROP
FUNCTION
IF
EXISTS
`copy_auth`
;
delimiter
;;
delimiter
;;
CREATE
FUNCTION
`copy_auth`
(
authSource
varchar
(
255
),
authSourceType
varchar
(
255
),
authUser
varchar
(
255
))
CREATE
FUNCTION
`copy_auth`
(
authSource
varchar
(
255
),
authSourceType
varchar
(
255
),
authUser
varchar
(
255
))
...
@@ -130,25 +128,25 @@ select id from sys_auth where sys_auth.auth_source=authSource and sys_auth.auth
...
@@ -130,25 +128,25 @@ select id from sys_auth where sys_auth.auth_source=authSource and sys_auth.auth
delete
from
sys_auth
where
sys_auth
.
auth_source
=
authSource
and
sys_auth
.
auth_source_type
=
authSourceType
;
delete
from
sys_auth
where
sys_auth
.
auth_source
=
authSource
and
sys_auth
.
auth_source_type
=
authSourceType
;
INSERT
INTO
sys_auth
(
INSERT
INTO
sys_auth
(
id
,
id
,
auth_source
,
auth_source
,
auth_source_type
,
auth_source_type
,
auth_target
,
auth_target
,
auth_target_type
,
auth_target_type
,
auth_time
,
auth_time
,
auth_user
auth_user
)
)
VALUES
VALUES
(
(
authId
,
authId
,
authSource
,
authSource
,
authSourceType
,
authSourceType
,
userId
,
userId
,
'user'
,
'user'
,
unix_timestamp
(
unix_timestamp
(
now
())
*
1000
,
'auto'
);
now
())
*
1000
,
'auto'
);
INSERT
INTO
sys_auth_detail
(
INSERT
INTO
sys_auth_detail
(
id
,
id
,
auth_id
,
auth_id
,
privilege_name
,
privilege_name
,
...
@@ -175,50 +173,52 @@ VALUES
...
@@ -175,50 +173,52 @@ VALUES
insert
into
sys_auth
(
insert
into
sys_auth
(
id
,
id
,
auth_source
,
auth_source
,
auth_source_type
,
auth_source_type
,
auth_target
,
auth_target
,
auth_target_type
,
auth_target_type
,
auth_time
,
auth_time
,
auth_user
,
auth_user
,
copy_from
,
copy_from
,
copy_id
copy_id
)
)
SELECT
SELECT
uuid
()
as
id
,
uuid
()
as
id
,
authSource
as
auth_source
,
authSource
as
auth_source
,
authSourceType
as
auth_source_type
,
authSourceType
as
auth_source_type
,
auth_target
,
auth_target
,
auth_target_type
,
auth_target_type
,
NOW
()
*
1000
as
auth_time
,
NOW
()
*
1000
as
auth_time
,
'auto'
as
auth_user
,
'auto'
as
auth_user
,
id
as
copy_from
,
id
as
copy_from
,
copyId
as
copy_id
copyId
as
copy_id
FROM
FROM
sys_auth
sys_auth
WHERE
WHERE
auth_source
IN
(
auth_source
=
(
SELECT
SELECT
pid
pid
FROM
FROM
v_auth_model
v_auth_model
WHERE
WHERE
id
=
authSource
id
=
authSource
AND
model_type
=
authSourceType
AND
model_type
=
authSourceType
)
)
AND
auth_source_type
=
authSourceType
;
AND
auth_source_type
=
authSourceType
and
concat
(
auth_target
,
'-'
,
auth_target_type
)
!=
CONCAT
(
userId
,
'-'
,
'user'
);
INSERT
INTO
sys_auth_detail
(
INSERT
INTO
sys_auth_detail
(
id
,
id
,
auth_id
,
auth_id
,
privilege_name
,
privilege_name
,
privilege_type
,
privilege_type
,
privilege_value
,
privilege_value
,
privilege_extend
,
privilege_extend
,
remark
,
remark
,
create_user
,
create_user
,
create_time
,
create_time
,
copy_from
,
copy_from
,
copy_id
copy_id
)
SELECT
)
SELECT
uuid
()
AS
id
,
uuid
()
AS
id
,
sa_copy
.
t_id
AS
auth_id
,
sa_copy
.
t_id
AS
auth_id
,
...
@@ -233,16 +233,38 @@ now())* 1000 AS create_time,
...
@@ -233,16 +233,38 @@ now())* 1000 AS create_time,
id
AS
copy_from
,
id
AS
copy_from
,
copyId
AS
copy_id
copyId
AS
copy_id
FROM
FROM
sys_auth_detail
sys_auth_detail
INNER
JOIN
(
INNER
JOIN
(
SELECT
SELECT
id
AS
t_id
,
id
AS
t_id
,
copy_from
AS
s_id
copy_from
AS
s_id
FROM
FROM
sys_auth
sys_auth
WHERE
WHERE
copy_id
=
copyId
copy_id
=
copyId
)
sa_copy
ON
sys_auth_detail
.
auth_id
=
sa_copy
.
s_id
;
)
sa_copy
ON
sys_auth_detail
.
auth_id
=
sa_copy
.
s_id
;
RETURN
'success'
;
END
;;
delimiter
;
-- ----------------------------
-- Function structure for delete_auth_source
-- ----------------------------
DROP
FUNCTION
IF
EXISTS
`delete_auth_source`
;
delimiter
;;
CREATE
FUNCTION
`delete_auth_source`
(
authSource
varchar
(
255
),
authSourceType
varchar
(
255
))
RETURNS
varchar
(
255
)
CHARSET
utf8mb4
READS
SQL
DATA
BEGIN
delete
from
sys_auth_detail
where
auth_id
in
(
select
id
from
sys_auth
where
sys_auth
.
auth_source
=
authSource
and
sys_auth
.
auth_source_type
=
authSourceType
);
delete
from
sys_auth
where
sys_auth
.
auth_source
=
authSource
and
sys_auth
.
auth_source_type
=
authSourceType
;
RETURN
'success'
;
RETURN
'success'
;
...
@@ -336,3 +358,8 @@ CREATE TABLE `panel_outer_params_target_view_info` (
...
@@ -336,3 +358,8 @@ CREATE TABLE `panel_outer_params_target_view_info` (
SET
FOREIGN_KEY_CHECKS
=
1
;
SET
FOREIGN_KEY_CHECKS
=
1
;
update
`my_plugin`
set
`name`
=
'X-Pack默认插件'
where
`plugin_id`
=
1
;
update
`my_plugin`
set
`name`
=
'X-Pack默认插件'
where
`plugin_id`
=
1
;
update
`my_plugin`
set
`module_name`
=
'view-bubblemap-backend'
where
`plugin_id`
=
2
;
update
`my_plugin`
set
`module_name`
=
'view-bubblemap-backend'
where
`plugin_id`
=
2
;
DROP
TRIGGER
`new_auth_panel`
;
DROP
TRIGGER
`new_auth_dataset_group`
;
DROP
TRIGGER
`new_auth_dataset_table`
;
DROP
TRIGGER
`new_auth_link`
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论