Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
a2c4ab11
提交
a2c4ab11
编写于
3月 17, 2021
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
userauth 改动
上级
0ec4a9d2
变更
3
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
32 行增加
和
7 行删除
+32
-7
UserDingtalkRegisterService.java
...e/uaa/extensions/service/UserDingtalkRegisterService.java
+22
-5
UserQQRegisterService.java
...ab/core/uaa/extensions/service/UserQQRegisterService.java
+4
-1
UserWechatRegisterService.java
...ore/uaa/extensions/service/UserWechatRegisterService.java
+6
-1
未找到文件。
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/service/UserDingtalkRegisterService.java
浏览文件 @
a2c4ab11
...
...
@@ -61,8 +61,14 @@ public class UserDingtalkRegisterService {
if
((
sysOpenAccess
==
null
||
(
sysOpenAccess
.
getDisabled
()!=
null
&&
sysOpenAccess
.
getDisabled
()==
1
))&&
throwEx
)
throw
new
BadRequestAlertException
(
"获取接入配置失败"
,
"UserDingtalkRegisterService"
,
""
);
try
{
String
accessToken
=
dingTalkTokenService
.
getAccessToken
(
sysOpenAccess
.
getAccessKey
(),
sysOpenAccess
.
getSecretKey
());
sysOpenAccess
.
setAccessToken
(
accessToken
);
}
catch
(
Exception
ex
)
{
}
return
sysOpenAccess
;
}
...
...
@@ -93,7 +99,11 @@ public class UserDingtalkRegisterService {
if
(
user
==
null
)
{
//查不到情况下到auth表查真实userId
SysUserAuth
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
"dingtalk"
).
eq
(
SysUserAuth:
:
getIdentifier
,
userId
),
false
);
SysUserAuth
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
openAccess
.
getId
()).
eq
(
SysUserAuth:
:
getIdentifier
,
userId
),
false
);
if
(
userAuth
==
null
)
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
"dingtalk"
).
eq
(
SysUserAuth:
:
getIdentifier
,
userId
),
false
);
// 该钉钉用户注册过账号,登录系统
if
(
userAuth
!=
null
)
{
user
=
sysUserService
.
getById
(
userAuth
.
getUserid
());
...
...
@@ -115,8 +125,10 @@ public class UserDingtalkRegisterService {
*/
public
JSONObject
getUserBySnsToken
(
String
id
,
String
requestAuthCode
)
{
JSONObject
returnObj
=
new
JSONObject
();
final
String
accessid
=
StringUtils
.
isEmpty
(
id
)?
"dingtalk"
:
id
;
SysOpenAccess
openAccess
=
sysOpenAccessService
.
getOne
(
Wrappers
.<
SysOpenAccess
>
lambdaQuery
().
eq
(
SysOpenAccess:
:
getOpenType
,
"dingtalk"
).
and
(
wrapper
->
wrapper
.
eq
(
SysOpenAccess:
:
getAccessKey
,
accessid
).
or
().
eq
(
SysOpenAccess:
:
getId
,
accessid
)),
false
);
SysOpenAccess
openAccess
=
getOpenAccess
(
id
);
if
(
openAccess
==
null
||
(
openAccess
.
getDisabled
()!=
null
&&
openAccess
.
getDisabled
()==
1
))
throw
new
BadRequestAlertException
(
"未找到配置"
,
"UserDingtalkRegisterService"
,
""
);
...
...
@@ -134,7 +146,12 @@ public class UserDingtalkRegisterService {
returnObj
.
put
(
"openid"
,
response
.
getUserInfo
().
getOpenid
());
returnObj
.
put
(
"nickname"
,
response
.
getUserInfo
().
getNick
());
returnObj
.
put
(
"unionid"
,
response
.
getUserInfo
().
getUnionid
());
SysUserAuth
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
"dingtalk"
)
SysUserAuth
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
openAccess
.
getId
())
.
and
(
wrapper
->
wrapper
.
eq
(
SysUserAuth:
:
getIdentifier
,
response
.
getUserInfo
().
getOpenid
()).
or
().
eq
(
SysUserAuth:
:
getIdentifier
,
response
.
getUserInfo
().
getUnionid
())
),
false
);
if
(
userAuth
==
null
)
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
"dingtalk"
)
.
and
(
wrapper
->
wrapper
.
eq
(
SysUserAuth:
:
getIdentifier
,
response
.
getUserInfo
().
getOpenid
()).
or
().
eq
(
SysUserAuth:
:
getIdentifier
,
response
.
getUserInfo
().
getUnionid
())
),
false
);
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/service/UserQQRegisterService.java
浏览文件 @
a2c4ab11
...
...
@@ -107,7 +107,10 @@ public class UserQQRegisterService {
if
(
responseObj2
.
containsKey
(
"openid"
))
{
openid
=
responseObj2
.
getString
(
"openid"
);
returnObj
.
put
(
"openid"
,
openid
);
SysUserAuth
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
"qq"
).
eq
(
SysUserAuth:
:
getIdentifier
,
openid
),
false
);
SysUserAuth
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
openAccess
.
getId
()).
eq
(
SysUserAuth:
:
getIdentifier
,
openid
),
false
);
if
(
userAuth
==
null
)
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
"qq"
).
eq
(
SysUserAuth:
:
getIdentifier
,
openid
),
false
);
SysUser
user
=
null
;
// 该qq用户注册过账号,登录系统
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/service/UserWechatRegisterService.java
浏览文件 @
a2c4ab11
...
...
@@ -79,7 +79,12 @@ public class UserWechatRegisterService {
String
unionid
=
returnObj
.
getString
(
"unionid"
);
SysUserAuth
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
"wechat"
)
SysUserAuth
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
openAccess
.
getId
())
.
and
(
wrapper
->
wrapper
.
eq
(
SysUserAuth:
:
getIdentifier
,
openid
).
or
().
eq
(
SysUserAuth:
:
getIdentifier
,
unionid
)
),
false
);
if
(
userAuth
==
null
)
userAuth
=
sysUserAuthService
.
getOne
(
Wrappers
.<
SysUserAuth
>
lambdaQuery
().
eq
(
SysUserAuth:
:
getIdentityType
,
"wechat"
)
.
and
(
wrapper
->
wrapper
.
eq
(
SysUserAuth:
:
getIdentifier
,
openid
).
or
().
eq
(
SysUserAuth:
:
getIdentifier
,
unionid
)
),
false
);
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录