Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
47013101
提交
47013101
编写于
8月 07, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SysOperator接管
上级
8d3e341e
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
68 行增加
和
27 行删除
+68
-27
UAACoreResource.java
.../java/cn/ibizlab/api/rest/extensions/UAACoreResource.java
+40
-0
UserDingtalkRegisterResource.java
...lab/api/rest/extensions/UserDingtalkRegisterResource.java
+9
-9
UserQQRegisterResource.java
...n/ibizlab/api/rest/extensions/UserQQRegisterResource.java
+10
-9
UserWechatRegisterResource.java
...izlab/api/rest/extensions/UserWechatRegisterResource.java
+9
-9
未找到文件。
ibzuaa-provider/ibzuaa-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/UAACoreResource.java
浏览文件 @
47013101
...
...
@@ -6,16 +6,20 @@ import cn.ibizlab.api.mapping.SysPSSystemMapping;
import
cn.ibizlab.api.mapping.SysRolePermissionMapping
;
import
cn.ibizlab.core.uaa.domain.SysPSSystem
;
import
cn.ibizlab.core.uaa.domain.SysRolePermission
;
import
cn.ibizlab.core.uaa.domain.SysUser
;
import
cn.ibizlab.core.uaa.extensions.domain.PermissionNode
;
import
cn.ibizlab.core.uaa.extensions.domain.SysStructure
;
import
cn.ibizlab.core.uaa.extensions.service.SysAppService
;
import
cn.ibizlab.core.uaa.extensions.service.UAACoreService
;
import
cn.ibizlab.core.uaa.service.ISysPSSystemService
;
import
cn.ibizlab.core.uaa.service.ISysRolePermissionService
;
import
cn.ibizlab.core.uaa.service.ISysUserService
;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.http.HttpRequest
;
import
org.springframework.http.HttpStatus
;
...
...
@@ -26,6 +30,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.constraints.NotBlank
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -110,4 +115,39 @@ public class UAACoreResource {
return
ResponseEntity
.
ok
().
body
(
uaaCoreService
.
getPublicKey
());
}
@Cacheable
(
value
=
"ibzuaa-model"
,
key
=
"'catalog:SysOperator'"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictionarys/catalogs/SysOperator"
)
public
ResponseEntity
<
JSONObject
>
getCatalog
()
{
return
getOptions
(
"SysOperator"
);
}
@Cacheable
(
value
=
"ibzuaa-model"
,
key
=
"'codelist:SysOperator'"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictionarys/codelist/SysOperator"
)
public
ResponseEntity
<
JSONObject
>
getCodeList
()
{
return
getOptions
(
"SysOperator"
);
}
@Autowired
private
ISysUserService
userService
;;
public
ResponseEntity
<
JSONObject
>
getOptions
(
String
catalog
)
{
JSONObject
jo
=
new
JSONObject
();
jo
.
put
(
"srfkey"
,
catalog
);
jo
.
put
(
"emptytext"
,
""
);
List
<
JSONObject
>
list
=
new
ArrayList
<>();
userService
.
list
().
forEach
(
item
->
{
JSONObject
option
=
new
JSONObject
();
option
.
put
(
"id"
,
item
.
getUserid
());
option
.
put
(
"value"
,
item
.
getUserid
());
option
.
put
(
"label"
,
item
.
getUsername
());
option
.
put
(
"text"
,
item
.
getUsername
());
list
.
add
(
option
);
});
jo
.
put
(
"items"
,
list
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
jo
);
}
}
ibzuaa-provider/ibzuaa-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/UserDingtalkRegisterResource.java
浏览文件 @
47013101
...
...
@@ -49,12 +49,12 @@ public class UserDingtalkRegisterResource {
@GetMapping
(
value
=
"/uaa/getDingtalkAppId"
)
public
ResponseEntity
<
JSONObject
>
getDingtalkAppId
()
{
JSONObject
obj
=
new
JSONObject
();
SysOpenAccess
openAccess
=
openAccessService
.
get
One
(
Wrappers
.<
SysOpenAccess
>
query
().
eq
(
"open_type"
,
"dingtalk"
)
);
if
(
!
"1"
.
equals
(
openAccess
.
getDisabled
()))
{
String
appId
=
openAccess
.
getAccessKey
(
);
if
(!
StringUtils
.
isEmpty
(
appId
))
{
obj
.
put
(
"appid"
,
appId
);
}
SysOpenAccess
openAccess
=
openAccessService
.
get
ById
(
"dingtalk"
);
if
(
openAccess
==
null
||
(
openAccess
.
getDisabled
()!=
null
&&
openAccess
.
getDisabled
()==
1
))
return
ResponseEntity
.
ok
(
obj
);
String
appId
=
openAccess
.
getAccessKey
();
// qq互联appid
if
(!
StringUtils
.
isEmpty
(
appId
))
{
obj
.
put
(
"appid"
,
appId
);
}
return
ResponseEntity
.
ok
(
obj
);
...
...
@@ -76,9 +76,9 @@ public class UserDingtalkRegisterResource {
throw
new
BadRequestAlertException
(
"code为空"
,
"UserDingtalkRegisterResource"
,
""
);
// 从数据库中获取钉钉授权应用信息
SysOpenAccess
openAccess
=
openAccessService
.
get
One
(
Wrappers
.<
SysOpenAccess
>
query
().
eq
(
"open_type"
,
"dingtalk"
)
);
if
(
"1"
.
equals
(
openAccess
.
getDisabled
())
||
StringUtils
.
isEmpty
(
openAccess
))
throw
new
BadRequestAlertException
(
"未
获得钉钉授权
"
,
"UserDingtalkRegisterResource"
,
""
);
SysOpenAccess
openAccess
=
openAccessService
.
get
ById
(
"dingtalk"
);
if
(
openAccess
==
null
||
(
openAccess
.
getDisabled
()!=
null
&&
openAccess
.
getDisabled
()==
1
))
throw
new
BadRequestAlertException
(
"未
找到配置
"
,
"UserDingtalkRegisterResource"
,
""
);
String
appId
=
openAccess
.
getAccessKey
();
// 个人应用开发过程中的唯一性标识AppId
String
appSecret
=
openAccess
.
getSecretKey
();
// 个人应用AppSecret
...
...
ibzuaa-provider/ibzuaa-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/UserQQRegisterResource.java
浏览文件 @
47013101
...
...
@@ -50,14 +50,15 @@ public class UserQQRegisterResource {
@GetMapping
(
value
=
"/uaa/getQQAppId"
)
public
ResponseEntity
<
JSONObject
>
getQQAppId
()
{
JSONObject
obj
=
new
JSONObject
();
SysOpenAccess
openAccess
=
openAccessService
.
get
One
(
Wrappers
.<
SysOpenAccess
>
query
().
eq
(
"open_type"
,
"qq"
)
);
if
(
!
"1"
.
equals
(
openAccess
.
getDisabled
()))
{
String
appId
=
openAccess
.
getAccessKey
();
// qq互联appid
if
(!
StringUtils
.
isEmpty
(
appId
))
{
obj
.
put
(
"appid"
,
appId
);
}
SysOpenAccess
openAccess
=
openAccessService
.
get
ById
(
"qq"
);
if
(
openAccess
==
null
||
(
openAccess
.
getDisabled
()!=
null
&&
openAccess
.
getDisabled
()==
1
))
return
ResponseEntity
.
ok
(
obj
);
String
appId
=
openAccess
.
getAccessKey
();
// qq互联appid
if
(!
StringUtils
.
isEmpty
(
appId
))
{
obj
.
put
(
"appid"
,
appId
);
}
return
ResponseEntity
.
ok
(
obj
);
}
...
...
@@ -76,9 +77,9 @@ public class UserQQRegisterResource {
throw
new
BadRequestAlertException
(
"code为空"
,
"UserQQRegisterResource"
,
""
);
// 从数据库中获取qq互联信息
SysOpenAccess
openAccess
=
openAccessService
.
get
One
(
Wrappers
.<
SysOpenAccess
>
query
().
eq
(
"open_type"
,
"qq"
)
);
if
(
"1"
.
equals
(
openAccess
.
getDisabled
())
||
StringUtils
.
isEmpty
(
openAccess
))
throw
new
BadRequestAlertException
(
"未
获得qq授权
"
,
"UserQQRegisterResource"
,
""
);
SysOpenAccess
openAccess
=
openAccessService
.
get
ById
(
"qq"
);
if
(
openAccess
==
null
||
(
openAccess
.
getDisabled
()!=
null
&&
openAccess
.
getDisabled
()==
1
))
throw
new
BadRequestAlertException
(
"未
找到配置
"
,
"UserQQRegisterResource"
,
""
);
String
appId
=
openAccess
.
getAccessKey
();
// qq互联appid
String
appSecret
=
openAccess
.
getSecretKey
();
// qq互联appkey
String
redirectUri
=
openAccess
.
getRedirectUri
();
// qq互联应用回调地址
...
...
ibzuaa-provider/ibzuaa-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/UserWechatRegisterResource.java
浏览文件 @
47013101
...
...
@@ -50,12 +50,12 @@ public class UserWechatRegisterResource {
@GetMapping
(
value
=
"/uaa/getWechatAppId"
)
public
ResponseEntity
<
JSONObject
>
getWechatAppId
()
{
JSONObject
obj
=
new
JSONObject
();
SysOpenAccess
openAccess
=
openAccessService
.
get
One
(
Wrappers
.<
SysOpenAccess
>
query
().
eq
(
"open_type"
,
"webchart"
)
);
if
(
!
"1"
.
equals
(
openAccess
.
getDisabled
()))
{
String
appId
=
openAccess
.
getAccessKey
(
);
if
(!
StringUtils
.
isEmpty
(
appId
))
{
obj
.
put
(
"appid"
,
appId
);
}
SysOpenAccess
openAccess
=
openAccessService
.
get
ById
(
"webchart"
);
if
(
openAccess
==
null
||
(
openAccess
.
getDisabled
()!=
null
&&
openAccess
.
getDisabled
()==
1
))
return
ResponseEntity
.
ok
(
obj
);
String
appId
=
openAccess
.
getAccessKey
();
// qq互联appid
if
(!
StringUtils
.
isEmpty
(
appId
))
{
obj
.
put
(
"appid"
,
appId
);
}
return
ResponseEntity
.
ok
(
obj
);
...
...
@@ -77,9 +77,9 @@ public class UserWechatRegisterResource {
throw
new
BadRequestAlertException
(
"code为空"
,
"UserWechatRegisterResource"
,
""
);
// 从数据库中获取微信授权应用信息
SysOpenAccess
openAccess
=
openAccessService
.
get
One
(
Wrappers
.<
SysOpenAccess
>
query
().
eq
(
"open_type"
,
"webchart"
)
);
if
(
"1"
.
equals
(
openAccess
.
getDisabled
())
||
StringUtils
.
isEmpty
(
openAccess
))
throw
new
BadRequestAlertException
(
"未
获得微信授权
"
,
"UserWechatRegisterResource"
,
""
);
SysOpenAccess
openAccess
=
openAccessService
.
get
ById
(
"webchart"
);
if
(
openAccess
==
null
||
(
openAccess
.
getDisabled
()!=
null
&&
openAccess
.
getDisabled
()==
1
))
throw
new
BadRequestAlertException
(
"未
找到配置
"
,
"UserWechatRegisterResource"
,
""
);
String
appId
=
openAccess
.
getAccessKey
();
// 微信开放平台appid
String
appSecret
=
openAccess
.
getSecretKey
();
// 微信开放平台appsecret
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录