Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cmeeting
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
翟斌
cmeeting
Commits
13827460
提交
13827460
authored
7月 09, 2025
作者:
duanxincheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
卡片跳转权限控制
父级
c6803426
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
60 行增加
和
2 行删除
+60
-2
src/main/java/com/cmeeting/ad/controller/UserController.java
+6
-1
src/main/java/com/cmeeting/ad/service/impl/UserServiceImpl.java
+50
-0
src/main/java/com/cmeeting/pojo/UserId.java
+3
-0
src/main/java/com/cmeeting/service/impl/TencentMeetingServiceImpl.java
+1
-1
没有找到文件。
src/main/java/com/cmeeting/ad/controller/UserController.java
浏览文件 @
13827460
...
@@ -38,7 +38,12 @@ public class UserController {
...
@@ -38,7 +38,12 @@ public class UserController {
@PostMapping
(
value
=
"/tokenAuth"
)
@PostMapping
(
value
=
"/tokenAuth"
)
public
R
tokenAuth
(
@Validated
@RequestBody
ApplicationUserVO
.
LoginDecrypt
vo
)
{
public
R
tokenAuth
(
@Validated
@RequestBody
ApplicationUserVO
.
LoginDecrypt
vo
)
{
return
R
.
ok
(
userService
.
tokenAuth
(
vo
));
try
{
Object
token
=
userService
.
tokenAuth
(
vo
);
return
R
.
ok
(
token
);
}
catch
(
Exception
e
)
{
return
R
.
error
(
e
.
getMessage
());
}
}
}
@PostMapping
(
value
=
"/emailAuth"
)
@PostMapping
(
value
=
"/emailAuth"
)
...
...
src/main/java/com/cmeeting/ad/service/impl/UserServiceImpl.java
浏览文件 @
13827460
...
@@ -11,6 +11,7 @@ import com.cmeeting.ad.util.SecurityUtil;
...
@@ -11,6 +11,7 @@ import com.cmeeting.ad.util.SecurityUtil;
import
com.cmeeting.ad.vo.UserVo
;
import
com.cmeeting.ad.vo.UserVo
;
import
com.cmeeting.dto.UserDTO
;
import
com.cmeeting.dto.UserDTO
;
import
com.cmeeting.exception.RobotBaseException
;
import
com.cmeeting.exception.RobotBaseException
;
import
com.cmeeting.mapper.primary.AuthMapper
;
import
com.cmeeting.mapper.primary.CommonMapper
;
import
com.cmeeting.mapper.primary.CommonMapper
;
import
com.cmeeting.ad.service.ILdapService
;
import
com.cmeeting.ad.service.ILdapService
;
import
com.cmeeting.ad.service.ISysTenantService
;
import
com.cmeeting.ad.service.ISysTenantService
;
...
@@ -55,6 +56,8 @@ public class UserServiceImpl implements UserService {
...
@@ -55,6 +56,8 @@ public class UserServiceImpl implements UserService {
public
String
permissionTenantId
;
public
String
permissionTenantId
;
@Value
(
"${permission.admin-white_users}"
)
@Value
(
"${permission.admin-white_users}"
)
public
String
adminWhiteUsers
;
public
String
adminWhiteUsers
;
@Value
(
value
=
"${permission.applicationId}"
)
private
String
permissionApplicationId
;
@Resource
@Resource
private
ILdapService
iLdapService
;
private
ILdapService
iLdapService
;
@Resource
@Resource
...
@@ -71,6 +74,10 @@ public class UserServiceImpl implements UserService {
...
@@ -71,6 +74,10 @@ public class UserServiceImpl implements UserService {
private
CommonMapper
commonMapper
;
private
CommonMapper
commonMapper
;
@Resource
@Resource
private
SysUserSysMapper
sysUserSysMapper
;
private
SysUserSysMapper
sysUserSysMapper
;
@Resource
private
AuthMapper
authMapper
;
@Resource
private
SysUserSysMapper
sysUserSyncMapper
;
@Override
@Override
public
R
login
(
String
agentId
,
String
data
,
String
ip
)
{
public
R
login
(
String
agentId
,
String
data
,
String
ip
)
{
...
@@ -246,6 +253,27 @@ public class UserServiceImpl implements UserService {
...
@@ -246,6 +253,27 @@ public class UserServiceImpl implements UserService {
JSONObject
data
=
object
.
getJSONObject
(
"data"
);
JSONObject
data
=
object
.
getJSONObject
(
"data"
);
RobotSecurityUser
robotSecurityUser
=
JSON
.
parseObject
(
data
.
toJSONString
(),
RobotSecurityUser
.
class
);
RobotSecurityUser
robotSecurityUser
=
JSON
.
parseObject
(
data
.
toJSONString
(),
RobotSecurityUser
.
class
);
String
userId
=
String
.
format
(
"%08d"
,
robotSecurityUser
.
getUserId
());
String
userId
=
String
.
format
(
"%08d"
,
robotSecurityUser
.
getUserId
());
//权限控制
List
<
CoreModulePermissions
>
auths
=
authMapper
.
getAuthByTargetId
(
permissionApplicationId
,
permissionTenantId
);
//先判断智能体是否有直接授权给当前登录人
boolean
userAccess
=
auths
.
stream
().
anyMatch
(
item
->
item
.
getType
().
equals
(
1
)
&&
item
.
getRelId
().
equals
(
userId
));
//未直接授权到人,判断是否有授权给当前登录人所在组织
if
(!
userAccess
){
List
<
CoreModulePermissions
>
authDepts
=
auths
.
stream
().
filter
(
item
->
item
.
getType
().
equals
(
0
)).
collect
(
Collectors
.
toList
());
List
<
String
>
deptPath
=
new
ArrayList
<>();
for
(
CoreModulePermissions
authDept
:
authDepts
)
{
String
deptId
=
authDept
.
getRelId
();
String
tenantId
=
authDept
.
getTenantId
();
getDeptPath
(
deptPath
,
deptId
,
tenantId
);
}
//已被授权部门下的userid
List
<
String
>
accessUserIds
=
!
CollectionUtils
.
isEmpty
(
deptPath
)
?
sysUserSyncMapper
.
getUsersByDept
(
deptPath
,
permissionTenantId
)
:
new
ArrayList
<>();
if
(!
accessUserIds
.
contains
(
userId
)){
throw
new
RobotBaseException
(
"您暂无权限"
);
}
}
UserVo
.
Auth
authParams
=
UserVo
.
Auth
.
builder
().
id
(
userId
).
nick
(
robotSecurityUser
.
getNickName
()).
build
();
UserVo
.
Auth
authParams
=
UserVo
.
Auth
.
builder
().
id
(
userId
).
nick
(
robotSecurityUser
.
getNickName
()).
build
();
String
token
=
auth
(
authParams
);
String
token
=
auth
(
authParams
);
return
token
;
return
token
;
...
@@ -311,4 +339,25 @@ public class UserServiceImpl implements UserService {
...
@@ -311,4 +339,25 @@ public class UserServiceImpl implements UserService {
return
R
.
error
(
"账号/密码错误!"
);
return
R
.
error
(
"账号/密码错误!"
);
}
}
}
}
/**
* 获取部门的路径
* @param deptPath
* @param deptId
* @param tenantId
*/
private
void
getDeptPath
(
List
<
String
>
deptPath
,
String
deptId
,
String
tenantId
)
{
if
(!
deptPath
.
contains
(
deptId
))
deptPath
.
add
(
deptId
);
List
<
String
>
subDeptIds
=
sysUserSyncMapper
.
getSubDeptId
(
deptId
,
tenantId
);
if
(
CollectionUtils
.
isEmpty
(
subDeptIds
))
return
;
for
(
String
subDeptId
:
subDeptIds
)
{
//部门id去重
if
(!
deptPath
.
contains
(
subDeptId
)){
deptPath
.
add
(
subDeptId
);
getDeptPath
(
deptPath
,
subDeptId
,
tenantId
);
}
}
}
}
}
\ No newline at end of file
src/main/java/com/cmeeting/pojo/UserId.java
浏览文件 @
13827460
package
com
.
cmeeting
.
pojo
;
package
com
.
cmeeting
.
pojo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -15,6 +17,7 @@ public class UserId {
...
@@ -15,6 +17,7 @@ public class UserId {
/**
/**
* 主键ID
* 主键ID
*/
*/
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Integer
id
;
/**
/**
...
...
src/main/java/com/cmeeting/service/impl/TencentMeetingServiceImpl.java
浏览文件 @
13827460
...
@@ -607,7 +607,7 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
...
@@ -607,7 +607,7 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
return
null
;
return
null
;
}
}
String
hostUserId
=
meetingInfo
.
getCurrentHosts
().
get
(
0
).
getUserid
();
String
hostUserId
=
meetingInfo
.
getCurrentHosts
().
get
(
0
).
getUserid
();
System
.
out
.
println
(
"成功获取主持人userid: {}"
+
hostUserId
);
log
.
info
(
"成功获取主持人userid: {}"
,
hostUserId
);
return
hostUserId
;
return
hostUserId
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
null
;
return
null
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论