Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
750fdaae
提交
750fdaae
编写于
5月 14, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
a96b989b
变更
5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
30 行增加
和
5 行删除
+30
-5
systemResource.json
...aa-core/src/main/resources/permission/systemResource.json
+15
-0
IBZUAAFallback.java
.../src/main/java/cn/ibizlab/util/client/IBZUAAFallback.java
+2
-1
IBZUAAFeignClient.java
...c/main/java/cn/ibizlab/util/client/IBZUAAFeignClient.java
+2
-1
PermissionSyncJob.java
.../src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
+8
-3
AppController.java
...til/src/main/java/cn/ibizlab/util/rest/AppController.java
+3
-0
未找到文件。
ibzuaa-core/src/main/resources/permission/systemResource.json
0 → 100644
浏览文件 @
750fdaae
{
"unires"
:[
],
"predefineddatarange"
:[{
"id"
:
"ALL"
,
"name"
:
"全部数据"
},{
"id"
:
"CURORG"
,
"name"
:
"当前单位"
},{
"id"
:
"PORG"
,
"name"
:
"上级单位"
},{
"id"
:
"SORG"
,
"name"
:
"下级单位"
},{
"id"
:
"CURORGDEPT"
,
"name"
:
"当前部门"
},{
"id"
:
"PORGDEPT"
,
"name"
:
"上级部门"
},{
"id"
:
"SORGDEPT"
,
"name"
:
"下级部门"
}],
"entities"
:[
],
"appmenus"
:[
{
"appid"
:
"web"
,
"appname"
:
"UAA鉴权"
,
"appmenu"
:[{
"menuid"
:
"Main"
,
"menuname"
:
"MAIN"
,
"menuitem"
:[{
"id"
:
"menuitem3"
,
"name"
:
"用户管理"
},{
"id"
:
"menuitem6"
,
"name"
:
"角色"
},{
"id"
:
"menuitem7"
,
"name"
:
"用户角色"
},{
"id"
:
"menuitem10"
,
"name"
:
"权限"
},{
"id"
:
"menuitem1"
,
"name"
:
"角色权限"
}]
}]
}
]
}
ibzuaa-util/src/main/java/cn/ibizlab/util/client/IBZUAAFallback.java
浏览文件 @
750fdaae
...
@@ -3,13 +3,14 @@ package cn.ibizlab.util.client;
...
@@ -3,13 +3,14 @@ package cn.ibizlab.util.client;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
cn.ibizlab.util.security.AuthorizationLogin
;
import
cn.ibizlab.util.security.AuthorizationLogin
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Map
;
import
java.util.Map
;
@Component
@Component
public
class
IBZUAAFallback
implements
IBZUAAFeignClient
{
public
class
IBZUAAFallback
implements
IBZUAAFeignClient
{
@Override
@Override
public
Map
<
String
,
Object
>
pushSystemPermissionData
(
Map
<
String
,
Object
>
systemPermissionData
,
String
systemId
)
{
public
JSONObject
pushSystemPermissionData
(
Map
<
String
,
Object
>
systemPermissionData
,
String
systemId
)
{
return
null
;
return
null
;
}
}
...
...
ibzuaa-util/src/main/java/cn/ibizlab/util/client/IBZUAAFeignClient.java
浏览文件 @
750fdaae
...
@@ -4,6 +4,7 @@ import cn.ibizlab.util.security.AuthenticationUser;
...
@@ -4,6 +4,7 @@ import cn.ibizlab.util.security.AuthenticationUser;
import
cn.ibizlab.util.security.AuthorizationLogin
;
import
cn.ibizlab.util.security.AuthorizationLogin
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Map
;
import
java.util.Map
;
@FeignClient
(
value
=
"ibzuaa-api"
,
fallback
=
IBZUAAFallback
.
class
)
@FeignClient
(
value
=
"ibzuaa-api"
,
fallback
=
IBZUAAFallback
.
class
)
...
@@ -16,7 +17,7 @@ public interface IBZUAAFeignClient
...
@@ -16,7 +17,7 @@ public interface IBZUAAFeignClient
* @return
* @return
*/
*/
@PostMapping
(
"/uaa/permission/save"
)
@PostMapping
(
"/uaa/permission/save"
)
Map
<
String
,
Object
>
pushSystemPermissionData
(
@RequestBody
Map
<
String
,
Object
>
systemPermissionData
,
@RequestParam
(
"systemid"
)
String
systemId
);
JSONObject
pushSystemPermissionData
(
@RequestBody
Map
<
String
,
Object
>
systemPermissionData
,
@RequestParam
(
"systemid"
)
String
systemId
);
/**
/**
* 用户登录
* 用户登录
...
...
ibzuaa-util/src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
浏览文件 @
750fdaae
...
@@ -39,15 +39,20 @@ public class PermissionSyncJob implements ApplicationRunner {
...
@@ -39,15 +39,20 @@ public class PermissionSyncJob implements ApplicationRunner {
public
void
run
(
ApplicationArguments
args
)
{
public
void
run
(
ApplicationArguments
args
)
{
if
(
enablePermissionValid
){
if
(
enablePermissionValid
){
try
{
try
{
InputStream
permission
=
this
.
getClass
().
getResourceAsStream
(
"/
deprivs/DEPrivs
.json"
);
//获取当前系统所有实体资源能力
InputStream
permission
=
this
.
getClass
().
getResourceAsStream
(
"/
permission/systemResource
.json"
);
//获取当前系统所有实体资源能力
String
permissionResult
=
IOUtils
.
toString
(
permission
,
"UTF-8"
);
String
permissionResult
=
IOUtils
.
toString
(
permission
,
"UTF-8"
);
JSONObject
jsonNodePermission
=
JSONObject
.
parseObject
(
permissionResult
);
JSONObject
jsonNodePermission
=
JSONObject
.
parseObject
(
permissionResult
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"permission"
,
jsonNodePermission
);
map
.
put
(
"permission"
,
jsonNodePermission
);
client
.
pushSystemPermissionData
(
map
,
systemId
);
JSONObject
syncResult
=
client
.
pushSystemPermissionData
(
map
,
systemId
);
if
(
syncResult
.
getInteger
(
"code"
)==
1
){
log
.
info
(
"向[UAA]同步系统资源成功"
);
}
else
{
log
.
info
(
String
.
format
(
"向[UAA]同步系统资源失败,失败原因为[%s]"
,
syncResult
.
getString
(
"msg"
)));
}
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
log
.
error
(
String
.
format
(
"向
UAA同步数据发生错误,请检查UAA
服务是否正常! [%s]"
,
ex
));
log
.
error
(
String
.
format
(
"向
[UAA]同步系统资源失败,请检查[UAA]
服务是否正常! [%s]"
,
ex
));
}
}
}
}
}
}
...
...
ibzuaa-util/src/main/java/cn/ibizlab/util/rest/AppController.java
浏览文件 @
750fdaae
...
@@ -23,13 +23,16 @@ public class AppController {
...
@@ -23,13 +23,16 @@ public class AppController {
JSONObject
appData
=
new
JSONObject
()
;
JSONObject
appData
=
new
JSONObject
()
;
JSONArray
uniRes
=
new
JSONArray
();
JSONArray
uniRes
=
new
JSONArray
();
JSONArray
appMenu
=
new
JSONArray
();
if
(
enablePermissionValid
){
if
(
enablePermissionValid
){
JSONObject
userPermission
=
AuthenticationUser
.
getAuthenticationUser
().
getPermissionList
();
JSONObject
userPermission
=
AuthenticationUser
.
getAuthenticationUser
().
getPermissionList
();
if
(!
ObjectUtils
.
isEmpty
(
userPermission
)){
if
(!
ObjectUtils
.
isEmpty
(
userPermission
)){
uniRes
=
userPermission
.
getJSONArray
(
"unires"
);
uniRes
=
userPermission
.
getJSONArray
(
"unires"
);
appMenu
=
userPermission
.
getJSONArray
(
"appmenu"
);
}
}
}
}
appData
.
put
(
"unires"
,
uniRes
);
appData
.
put
(
"unires"
,
uniRes
);
appData
.
put
(
"appmenu"
,
appMenu
);
appData
.
put
(
"enablepermissionvalid"
,
enablePermissionValid
);
appData
.
put
(
"enablepermissionvalid"
,
enablePermissionValid
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
appData
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
appData
);
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录