Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
f57116fc
提交
f57116fc
编写于
6月 07, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sysapp
上级
699461e8
变更
11
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
117 行增加
和
87 行删除
+117
-87
login.vue
app_web/src/components/login/login.vue
+2
-2
SysPSSystem.java
...src/main/java/cn/ibizlab/core/uaa/domain/SysPSSystem.java
+3
-3
SysPSSystemAspect.java
...ibizlab/core/uaa/extensions/aspect/SysPSSystemAspect.java
+1
-1
SysApp.java
...in/java/cn/ibizlab/core/uaa/extensions/domain/SysApp.java
+0
-20
SysStructure.java
...a/cn/ibizlab/core/uaa/extensions/domain/SysStructure.java
+1
-3
SysAppsTypeHandler.java
...re/uaa/extensions/domain/handlers/SysAppsTypeHandler.java
+0
-49
SysAppService.java
...cn/ibizlab/core/uaa/extensions/service/SysAppService.java
+93
-2
UAACoreService.java
...n/ibizlab/core/uaa/extensions/service/UAACoreService.java
+3
-5
SysPSSystemMapper.xml
...in/resources/mapper/uaa/syspssystem/SysPSSystemMapper.xml
+1
-1
SysPSSystemDTO.java
...-api/src/main/java/cn/ibizlab/api/dto/SysPSSystemDTO.java
+1
-1
ClientAuthenticationResource.java
...lab/api/rest/extensions/ClientAuthenticationResource.java
+12
-0
未找到文件。
app_web/src/components/login/login.vue
浏览文件 @
f57116fc
...
...
@@ -73,10 +73,10 @@
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Watch
}
from
'vue-property-decorator'
;
import
{
Environment
}
from
'@/environments/environment'
;
import
Divider
from
"ibiz-vue-lib/lib/ibiz-vue-lib.common"
;
//
import Divider from "ibiz-vue-lib/lib/ibiz-vue-lib.common";
@
Component
({
components
:
{
Divider
}
components
:
{}
})
export
default
class
Login
extends
Vue
{
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/domain/SysPSSystem.java
浏览文件 @
f57116fc
...
...
@@ -8,9 +8,9 @@ import java.math.BigInteger;
import
java.util.HashMap
;
import
java.math.BigDecimal
;
import
cn.ibizlab.core.uaa.
extensions.
domain.SysApp
;
import
cn.ibizlab.core.uaa.domain.SysApp
;
import
cn.ibizlab.core.uaa.extensions.domain.SysStructure
;
import
cn.ibizlab.core.uaa.
extensions.domain.handlers.SysApps
TypeHandler
;
import
cn.ibizlab.core.uaa.
domain.handlers.SysApp
TypeHandler
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
...
...
@@ -67,7 +67,7 @@ public class SysPSSystem extends EntityMP implements Serializable {
/**
* 结构
*/
@TableField
(
value
=
"apps"
,
typeHandler
=
SysApp
s
TypeHandler
.
class
)
@TableField
(
value
=
"apps"
,
typeHandler
=
SysAppTypeHandler
.
class
)
@JSONField
(
name
=
"apps"
)
@JsonProperty
(
"apps"
)
private
List
<
SysApp
>
apps
;
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/aspect/SysPSSystemAspect.java
浏览文件 @
f57116fc
...
...
@@ -3,7 +3,7 @@ package cn.ibizlab.core.uaa.extensions.aspect;
import
cn.ibizlab.core.uaa.domain.SysPSSystem
;
import
cn.ibizlab.core.uaa.domain.SysPermission
;
import
cn.ibizlab.core.uaa.extensions.domain.PermissionType
;
import
cn.ibizlab.core.uaa.
extensions.
domain.SysApp
;
import
cn.ibizlab.core.uaa.domain.SysApp
;
import
cn.ibizlab.core.uaa.extensions.service.SysAppService
;
import
cn.ibizlab.core.uaa.extensions.service.UAACoreService
;
import
cn.ibizlab.core.uaa.service.ISysPSSystemService
;
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/domain/SysApp.java
已删除
100644 → 0
浏览文件 @
699461e8
package
cn
.
ibizlab
.
core
.
uaa
.
extensions
.
domain
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
SysApp
{
private
String
id
;
private
String
label
;
private
String
systemid
;
private
String
fullName
;
private
String
type
;
private
String
addr
;
}
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/domain/SysStructure.java
浏览文件 @
f57116fc
package
cn
.
ibizlab
.
core
.
uaa
.
extensions
.
domain
;
import
cn.ibizlab.core.uaa.domain.Sys
PSSystem
;
import
cn.ibizlab.core.uaa.domain.Sys
App
;
import
cn.ibizlab.core.uaa.domain.SysPermission
;
import
cn.ibizlab.core.uaa.extensions.domain.Structure.AppNode
;
import
cn.ibizlab.core.uaa.extensions.domain.Structure.EntityNode
;
import
cn.ibizlab.core.uaa.extensions.domain.Structure.FuncItem
;
import
cn.ibizlab.core.uaa.extensions.domain.Structure.UniResNode
;
import
cn.ibizlab.core.uaa.filter.SysPSSystemSearchContext
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Data
;
import
org.springframework.data.domain.Page
;
import
java.sql.Timestamp
;
import
java.util.*
;
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/domain/handlers/SysAppsTypeHandler.java
已删除
100644 → 0
浏览文件 @
699461e8
package
cn
.
ibizlab
.
core
.
uaa
.
extensions
.
domain
.
handlers
;
import
cn.ibizlab.core.uaa.extensions.domain.SysApp
;
import
com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.JavaType
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.type.JdbcType
;
import
org.apache.ibatis.type.MappedJdbcTypes
;
import
org.apache.ibatis.type.MappedTypes
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
@Slf4j
@MappedTypes
({
List
.
class
})
@MappedJdbcTypes
(
JdbcType
.
VARCHAR
)
public
class
SysAppsTypeHandler
extends
AbstractJsonTypeHandler
<
List
>
{
private
static
ObjectMapper
objectMapper
=
new
ObjectMapper
();
private
JavaType
type
;
public
SysAppsTypeHandler
(
Class
<
List
>
type
)
{
this
.
type
=
objectMapper
.
getTypeFactory
().
constructParametricType
(
ArrayList
.
class
,
SysApp
.
class
);
}
@Override
protected
List
parse
(
String
json
)
{
try
{
return
objectMapper
.
readValue
(
json
,
type
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
@Override
protected
String
toJson
(
List
obj
)
{
try
{
return
objectMapper
.
writeValueAsString
(
obj
);
}
catch
(
JsonProcessingException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
public
static
void
setObjectMapper
(
ObjectMapper
objectMapper
)
{
SysAppsTypeHandler
.
objectMapper
=
objectMapper
;
}
}
\ No newline at end of file
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/service/SysAppService.java
浏览文件 @
f57116fc
package
cn
.
ibizlab
.
core
.
uaa
.
extensions
.
service
;
import
cn.ibizlab.core.uaa.domain.SysPSSystem
;
import
cn.ibizlab.core.uaa.extensions.domain.SysApp
;
import
cn.ibizlab.core.uaa.domain.SysApp
;
import
cn.ibizlab.core.uaa.filter.SysAppSearchContext
;
import
cn.ibizlab.core.uaa.filter.SysPSSystemSearchContext
;
import
cn.ibizlab.core.uaa.service.ISysAppService
;
import
cn.ibizlab.core.uaa.service.ISysPSSystemService
;
import
cn.ibizlab.core.uaa.service.impl.SysAppServiceImpl
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.helper.CachedBeanCopier
;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
cn.ibizlab.util.service.IBZConfigService
;
import
com.alibaba.fastjson.JSONArray
;
...
...
@@ -11,16 +16,21 @@ import com.alibaba.fastjson.JSONObject;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
@Primary
@Service
public
class
SysAppService
{
public
class
SysAppService
extends
SysAppServiceImpl
{
@Autowired
private
ISysPSSystemService
sysPSSystemService
;
...
...
@@ -44,6 +54,15 @@ public class SysAppService {
SysApp
def
=
defApps
.
get
(
sysApp
.
getId
());
if
(
def
==
null
)
return
;
sysApp
.
setAddr
(
def
.
getAddr
());
sysApp
.
setIcon
(
def
.
getIcon
());
sysApp
.
setFullname
(
def
.
getFullname
());
sysApp
.
setType
(
def
.
getType
());
sysApp
.
setVisabled
(
1
);
list
.
add
(
sysApp
);
defApps
.
remove
(
def
.
getId
());
});
defApps
.
values
().
forEach
(
sysApp
->
{
sysApp
.
setVisabled
(
0
);
list
.
add
(
sysApp
);
});
jo
.
remove
(
"model"
);
...
...
@@ -57,4 +76,76 @@ public class SysAppService {
}
@Override
public
SysApp
get
(
String
key
)
{
String
systemId
=
key
.
split
(
"-"
)[
0
];
SysPSSystem
sysPSSystem
=
sysPSSystemService
.
getById
(
systemId
);
if
(
sysPSSystem
!=
null
&&
sysPSSystem
.
getApps
()!=
null
)
{
for
(
SysApp
app:
sysPSSystem
.
getApps
())
{
if
(
app
.
getId
().
equals
(
key
))
return
app
;
}
}
return
null
;
}
@Override
public
boolean
save
(
SysApp
et
)
{
if
(
StringUtils
.
isEmpty
(
et
.
getSystemid
())||
StringUtils
.
isEmpty
(
et
.
getId
()))
throw
new
BadRequestAlertException
(
"应用参数缺失"
,
"SysApp"
,
et
.
getId
());
SysPSSystem
sysPSSystem
=
sysPSSystemService
.
getById
(
et
.
getSystemid
());
if
(
sysPSSystem
!=
null
&&
sysPSSystem
.
getApps
()!=
null
)
{
boolean
bchange
=
false
;
for
(
SysApp
app:
sysPSSystem
.
getApps
())
{
if
(
app
.
getId
().
equals
(
et
.
getId
()))
{
CachedBeanCopier
.
copy
(
et
,
app
);
bchange
=
true
;
break
;
}
}
if
(
bchange
)
sysPSSystemService
.
update
(
sysPSSystem
);
}
return
true
;
}
@Override
public
boolean
update
(
SysApp
et
)
{
return
this
.
save
(
et
);
}
@Override
public
boolean
create
(
SysApp
et
)
{
return
this
.
save
(
et
);
}
@Override
public
Page
<
SysApp
>
searchDefault
(
SysAppSearchContext
context
)
{
context
.
setSize
(
Integer
.
MAX_VALUE
);
List
<
SysApp
>
content
=
new
ArrayList
<>();
LinkedHashMap
<
String
,
SysApp
>
map
=
uaaCoreService
.
getApps
();
map
.
values
().
forEach
(
sysApp
->
{
if
(!
StringUtils
.
isEmpty
(
context
.
getN_pssystemid_eq
()))
{
if
(!
sysApp
.
getSystemid
().
equals
(
context
.
getN_pssystemid_eq
()))
return
;
}
if
(!
StringUtils
.
isEmpty
(
context
.
getN_appname_like
()))
{
if
(
sysApp
.
getLabel
().
indexOf
(
context
.
getN_appname_like
())<
0
&&
sysApp
.
getFullname
().
indexOf
(
context
.
getN_appname_like
())<
0
)
return
;
}
content
.
add
(
sysApp
);
});
return
new
PageImpl
<
SysApp
>(
content
,
context
.
getPageable
(),
content
.
size
());
}
}
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/service/UAACoreService.java
浏览文件 @
f57116fc
...
...
@@ -7,7 +7,7 @@ import cn.ibizlab.core.uaa.domain.SysRole;
import
cn.ibizlab.core.uaa.domain.SysRolePermission
;
import
cn.ibizlab.core.uaa.extensions.domain.PermissionNode
;
import
cn.ibizlab.core.uaa.extensions.domain.PermissionType
;
import
cn.ibizlab.core.uaa.
extensions.
domain.SysApp
;
import
cn.ibizlab.core.uaa.domain.SysApp
;
import
cn.ibizlab.core.uaa.filter.SysPSSystemSearchContext
;
import
cn.ibizlab.core.uaa.filter.SysRolePermissionSearchContext
;
import
cn.ibizlab.core.uaa.service.ISysPSSystemService
;
...
...
@@ -62,8 +62,7 @@ public class UAACoreService {
List
<
PermissionNode
>
apps
=
new
ArrayList
<>();
List
<
PermissionNode
>
uniResIds
=
new
ArrayList
<>();
List
<
PermissionNode
>
oppirvs
=
new
ArrayList
<>();
Page
<
SysPSSystem
>
page
=
sysPSSystemService
.
searchDefault
(
new
SysPSSystemSearchContext
());
page
.
getContent
().
forEach
(
system
->{
sysPSSystemService
.
list
().
forEach
(
system
->{
if
(
system
.
getSysstructure
()==
null
)
return
;
PermissionNode
appnode
=
system
.
getSysstructure
().
getPermissionTree
(
PermissionType
.
APPMENU
);
...
...
@@ -168,8 +167,7 @@ public class UAACoreService {
@Cacheable
(
value
=
"syspssystem"
,
key
=
"'row:all-apps'"
)
public
LinkedHashMap
<
String
,
SysApp
>
getApps
()
{
LinkedHashMap
<
String
,
SysApp
>
appNode
=
new
LinkedHashMap
<>();
Page
<
SysPSSystem
>
page
=
sysPSSystemService
.
searchDefault
(
new
SysPSSystemSearchContext
());
page
.
getContent
().
forEach
(
system
->
{
sysPSSystemService
.
list
().
forEach
(
system
->
{
if
(
system
.
getSysstructure
()
==
null
)
{
return
;
...
...
ibzuaa-core/src/main/resources/mapper/uaa/syspssystem/SysPSSystemMapper.xml
浏览文件 @
f57116fc
...
...
@@ -9,7 +9,7 @@
<resultMap
id=
"SysPSSystemResultMap"
type=
"cn.ibizlab.core.uaa.domain.SysPSSystem"
autoMapping=
"true"
>
<id
property=
"pssystemid"
column=
"pssystemid"
/>
<!--主键字段映射-->
<result
column=
"sysstructure"
jdbcType=
"VARCHAR"
property=
"sysstructure"
typeHandler=
"com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"
/>
<result
property=
"apps"
column=
"apps"
typeHandler=
"cn.ibizlab.core.uaa.
extensions.domain.handlers.SysApps
TypeHandler"
/>
<result
property=
"apps"
column=
"apps"
typeHandler=
"cn.ibizlab.core.uaa.
domain.handlers.SysApp
TypeHandler"
/>
</resultMap>
...
...
ibzuaa-provider/ibzuaa-provider-api/src/main/java/cn/ibizlab/api/dto/SysPSSystemDTO.java
浏览文件 @
f57116fc
...
...
@@ -9,7 +9,7 @@ import java.util.HashMap;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
cn.ibizlab.core.uaa.
extensions.
domain.SysApp
;
import
cn.ibizlab.core.uaa.domain.SysApp
;
import
cn.ibizlab.core.uaa.extensions.domain.SysStructure
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
...
...
ibzuaa-provider/ibzuaa-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/ClientAuthenticationResource.java
浏览文件 @
f57116fc
package
cn
.
ibizlab
.
api
.
rest
.
extensions
;
import
cn.ibizlab.core.uaa.extensions.service.SysAppService
;
import
cn.ibizlab.core.uaa.extensions.service.UAACoreService
;
import
cn.ibizlab.util.client.IBZOUFeignClient
;
import
cn.ibizlab.util.security.AuthTokenUtil
;
...
...
@@ -47,6 +48,8 @@ public class ClientAuthenticationResource
AuthenticationUser
user
=
userDetailsService
.
loadUserByLogin
(
authorizationLogin
.
getUsername
(),
authorizationLogin
.
getPassword
());
final
String
token
=
jwtTokenUtil
.
generateToken
(
user
);
user
.
setPermissionList
(
null
);
// 返回 token
return
ResponseEntity
.
ok
().
body
(
new
AuthenticationInfo
(
token
,
user
));
}
...
...
@@ -65,4 +68,13 @@ public class ClientAuthenticationResource
return
ResponseEntity
.
ok
().
body
(
user
);
}
@Autowired
private
SysAppService
sysAppService
;
@GetMapping
(
value
=
"uaa/access-center/nav/{id}"
)
public
ResponseEntity
<
JSONObject
>
appnavbar
(
@PathVariable
(
"id"
)
String
id
)
{
return
ResponseEntity
.
ok
(
sysAppService
.
getAppNavigationBar
(
id
,
AuthenticationUser
.
getAuthenticationUser
().
getUserid
()));
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录