Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cmeeting
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
翟斌
cmeeting
Commits
0052e55f
提交
0052e55f
authored
11月 26, 2025
作者:
洪东保
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
发送邮件带一个跳转到会议详情页面的链接
父级
5ef1fb26
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
52 行增加
和
15 行删除
+52
-15
src/main/java/com/cmeeting/ad/controller/UserController.java
+10
-2
src/main/java/com/cmeeting/ad/service/impl/UserServiceImpl.java
+1
-0
src/main/java/com/cmeeting/email/EmailSender.java
+17
-3
src/main/java/com/cmeeting/util/AESUtils.java
+24
-10
没有找到文件。
src/main/java/com/cmeeting/ad/controller/UserController.java
浏览文件 @
0052e55f
package
com
.
cmeeting
.
ad
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cmeeting.ad.service.UserService
;
import
com.cmeeting.ad.vo.UserVo
;
import
com.cmeeting.annotation.OperLog
;
import
com.cmeeting.constant.RecordTemplateConstant
;
import
com.cmeeting.util.AESUtils
;
import
com.cmeeting.util.IPUtils
;
import
com.cmeeting.util.R
;
import
com.cmeeting.ad.vo.ApplicationUserVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -19,6 +22,8 @@ public class UserController {
@Autowired
private
UserService
userService
;
@Value
(
"${aec.key}"
)
private
String
aseKey
;
/**
* 账号密码登录
...
...
@@ -61,7 +66,9 @@ public class UserController {
}
@PostMapping
(
value
=
"/emailAuth"
)
public
R
emailAuth
(
@Validated
@RequestBody
UserVo
.
Auth
vo
)
{
return
R
.
ok
(
userService
.
emailAuth
(
vo
));
public
R
emailAuth
(
@Validated
@RequestBody
UserVo
.
LoginDecrypt
vo
)
{
String
decrypt
=
AESUtils
.
decrypt
(
vo
.
getData
(),
aseKey
);
UserVo
.
Auth
auth
=
JSONObject
.
parseObject
(
decrypt
,
UserVo
.
Auth
.
class
);
return
R
.
ok
(
userService
.
emailAuth
(
auth
));
}
}
\ No newline at end of file
src/main/java/com/cmeeting/ad/service/impl/UserServiceImpl.java
浏览文件 @
0052e55f
...
...
@@ -152,6 +152,7 @@ public class UserServiceImpl implements UserService {
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"userId"
,
userId
);
stringStringHashMap
.
put
(
"tenantId"
,
permissionTenantId
);
stringStringHashMap
.
put
(
"role"
,
RecordTemplateConstant
.
TEMPLATE_TYPE_CUSTOM
);
stringStringHashMap
.
put
(
"nick"
,
nick
);
UsernamePasswordAuthenticationToken
usernamePasswordAuthenticationToken
=
new
UsernamePasswordAuthenticationToken
(
userId
,
permissionTenantId
);
usernamePasswordAuthenticationToken
.
setDetails
(
stringStringHashMap
);
...
...
src/main/java/com/cmeeting/email/EmailSender.java
浏览文件 @
0052e55f
package
com
.
cmeeting
.
email
;
import
cn.hutool.json.JSONUtil
;
import
com.azure.core.credential.AccessToken
;
import
com.azure.core.credential.TokenRequestContext
;
import
com.azure.identity.ClientSecretCredential
;
...
...
@@ -11,6 +12,7 @@ import com.cmeeting.exception.RobotBaseException;
import
com.cmeeting.log.service.ProcessLogService
;
import
com.cmeeting.pojo.MeetEmailTemplate
;
import
com.cmeeting.service.MeetEmailTemplateService
;
import
com.cmeeting.util.AESUtils
;
import
com.cmeeting.util.RSAUtils
;
import
com.cmeeting.util.RedisUtils
;
import
com.cmeeting.vo.EmailPush
;
...
...
@@ -36,6 +38,8 @@ import javax.mail.internet.*;
import
java.io.File
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.text.MessageFormat
;
...
...
@@ -61,7 +65,8 @@ public class EmailSender {
private
String
clientSecret
;
@Value
(
"${email.microsoft.tenantId}"
)
private
String
tenantId
;
@Value
(
"${aec.key}"
)
private
String
aseKey
;
@Resource
private
ProcessLogService
processLogService
;
@Resource
...
...
@@ -90,6 +95,7 @@ public class EmailSender {
String
subMeetingId
=
emailPushBuilder
.
getSubMeetingId
();
Integer
meetingInstanceId
=
emailPushBuilder
.
getMeetingInstanceId
();
String
toUserCode
=
emailPushBuilder
.
getToUserCode
();
String
toUser
=
emailPushBuilder
.
getToUser
();
Boolean
emailPushAccess
=
emailPushBuilder
.
getEmailPushAccess
();
//用户自定义邮件推送许可
if
(
emailPushAccess
)
{
...
...
@@ -142,8 +148,16 @@ public class EmailSender {
.
orderByDesc
(
MeetEmailTemplate:
:
getCreateTime
)
.
select
(
MeetEmailTemplate:
:
getContent
).
last
(
"limit 1"
));
String
emailContentTemplate
=
one
.
getContent
();
long
expireTimestamp
=
ZonedDateTime
.
now
().
plusDays
(
2
).
toInstant
().
toEpochMilli
();
body
.
content
=
MessageFormat
.
format
(
emailContentTemplate
,
meetingInstanceId
,
toUserCode
,
String
.
valueOf
(
expireTimestamp
));
long
expireTimestamp
=
ZonedDateTime
.
now
().
plusDays
(
1
).
toInstant
().
toEpochMilli
();
UserVo
.
Auth
auth
=
new
UserVo
.
Auth
();
auth
.
setId
(
toUserCode
);
auth
.
setNick
(
toUser
);
auth
.
setExpireDate
(
expireTimestamp
);
String
s
=
JSONUtil
.
toJsonStr
(
auth
);
String
encrypt
=
AESUtils
.
encrypt
(
s
,
aseKey
);
body
.
content
=
MessageFormat
.
format
(
emailContentTemplate
,
URLEncoder
.
encode
(
encrypt
,
StandardCharsets
.
UTF_8
.
name
()),
String
.
valueOf
(
meetingInstanceId
));
message
.
body
=
body
;
LinkedList
<
Recipient
>
toRecipientsList
=
new
LinkedList
<>();
...
...
src/main/java/com/cmeeting/util/AESUtils.java
浏览文件 @
0052e55f
...
...
@@ -3,6 +3,8 @@ package com.cmeeting.util;
//import com.google.api.client.repackaged.org.apache.commons.codec.binary.Base64;
import
cn.hutool.core.codec.Base64
;
import
cn.hutool.json.JSONUtil
;
import
com.cmeeting.ad.vo.UserVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.StringUtils
;
...
...
@@ -12,10 +14,13 @@ import javax.crypto.IllegalBlockSizeException;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.security.InvalidKeyException
;
import
java.text.MessageFormat
;
import
java.time.ZonedDateTime
;
@Slf4j
public
class
AESUtils
{
...
...
@@ -121,17 +126,26 @@ public class AESUtils {
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
filePath
=
"D:/desktop/a.txt"
;
try
{
byte
[]
bytes
=
Files
.
readAllBytes
(
Paths
.
get
(
filePath
));
String
longStr
=
new
String
(
bytes
,
StandardCharsets
.
UTF_8
);
String
miwen
=
decrypt
(
longStr
,
"biaopin123456789"
);
// 加密
System
.
out
.
println
(
miwen
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
// String filePath = "D:/desktop/a.txt";
// try {
// byte[] bytes = Files.readAllBytes(Paths.get(filePath));
// String longStr = new String(bytes, StandardCharsets.UTF_8);
// String miwen = decrypt(longStr,"");// 加密
// System.out.println(miwen);
// } catch (Exception e) {
// e.printStackTrace();
// }
UserVo
.
Auth
auth
=
new
UserVo
.
Auth
();
auth
.
setId
(
"00015545"
);
auth
.
setNick
(
"李"
);
long
expireTimestamp
=
ZonedDateTime
.
now
().
plusDays
(
2
).
toInstant
().
toEpochMilli
();
auth
.
setExpireDate
(
expireTimestamp
);
String
s
=
JSONUtil
.
toJsonStr
(
auth
);
String
encrypt
=
AESUtils
.
encrypt
(
s
,
"biaopin123456789"
);
System
.
out
.
println
(
encrypt
);
String
url
=
"https://chatbottest.cimc.com:5277/login?token={0}&source=email"
;
System
.
out
.
println
(
MessageFormat
.
format
(
url
,
URLEncoder
.
encode
(
encrypt
)));
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论