Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
16c95443
Commit
16c95443
authored
Nov 27, 2024
by
xuepeng.chang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改头像 记录日志
parent
8ce423fd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
UserCenterController.java
...controller/internal/user/center/UserCenterController.java
+6
-0
HttpClientUtil.java
src/main/java/cn/quantgroup/xyqb/util/HttpClientUtil.java
+1
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/center/UserCenterController.java
View file @
16c95443
...
@@ -322,6 +322,7 @@ public class UserCenterController implements IBaseController {
...
@@ -322,6 +322,7 @@ public class UserCenterController implements IBaseController {
executorService
.
execute
(()
->
{
executorService
.
execute
(()
->
{
try
{
try
{
String
avatarUrl
=
userInfoEntity
.
getPhoto
();
String
avatarUrl
=
userInfoEntity
.
getPhoto
();
log
.
info
(
"开始执行头像刷新.id={},avatarUrl={}"
,
userInfoEntity
.
getId
(),
avatarUrl
);
if
(
StringUtils
.
isEmpty
(
avatarUrl
)){
if
(
StringUtils
.
isEmpty
(
avatarUrl
)){
return
;
return
;
}
}
...
@@ -329,10 +330,15 @@ public class UserCenterController implements IBaseController {
...
@@ -329,10 +330,15 @@ public class UserCenterController implements IBaseController {
return
;
return
;
}
}
byte
[]
avatarBytes
=
HttpClientUtil
.
download
(
avatarUrl
);
byte
[]
avatarBytes
=
HttpClientUtil
.
download
(
avatarUrl
);
if
(
Objects
.
isNull
(
avatarBytes
)){
log
.
info
(
"下载头像失败.id={},avatarUrl={}"
,
userInfoEntity
.
getId
(),
avatarUrl
);
return
;
}
String
imageName
=
"avatar/"
+
UUID
.
randomUUID
().
toString
()+
".jpg"
;
String
imageName
=
"avatar/"
+
UUID
.
randomUUID
().
toString
()+
".jpg"
;
String
fileName
=
qiNiuYunUtil
.
overrideUpload
(
avatarBytes
,
".jpg"
,
imageName
);
String
fileName
=
qiNiuYunUtil
.
overrideUpload
(
avatarBytes
,
".jpg"
,
imageName
);
userInfoEntity
.
setPhoto
(
fileName
);
userInfoEntity
.
setPhoto
(
fileName
);
userInfoRepository
.
save
(
userInfoEntity
);
userInfoRepository
.
save
(
userInfoEntity
);
log
.
info
(
"开始执行头像刷新完成.id={},avatarUrl={}"
,
userInfoEntity
.
getId
(),
avatarUrl
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"refeshAvatar.error"
,
e
);
log
.
error
(
"refeshAvatar.error"
,
e
);
}
finally
{
}
finally
{
...
...
src/main/java/cn/quantgroup/xyqb/util/HttpClientUtil.java
View file @
16c95443
...
@@ -54,7 +54,7 @@ public class HttpClientUtil {
...
@@ -54,7 +54,7 @@ public class HttpClientUtil {
private
static
PoolingHttpClientConnectionManager
connectionManager
=
null
;
private
static
PoolingHttpClientConnectionManager
connectionManager
=
null
;
private
static
HttpRequestRetryHandler
retryHandler
=
null
;
private
static
HttpRequestRetryHandler
retryHandler
=
null
;
private
static
ConnectionKeepAliveStrategy
keepAliveStrategy
=
null
;
private
static
ConnectionKeepAliveStrategy
keepAliveStrategy
=
null
;
private
static
final
int
TIME_OUT
=
5
*
1000
;
// 超时时间
private
static
final
int
TIME_OUT
=
1
*
1000
;
// 超时时间
private
static
final
int
REQUEST_CONNECTION_TIME_OUT
=
1
*
1000
;
// 超时时间
private
static
final
int
REQUEST_CONNECTION_TIME_OUT
=
1
*
1000
;
// 超时时间
private
static
final
int
CONNECTION_TIME_OUT
=
2
*
1000
;
// 超时时间
private
static
final
int
CONNECTION_TIME_OUT
=
2
*
1000
;
// 超时时间
private
static
final
int
SOCKET_TIME_OUT
=
5
*
1000
;
// 超时时间
private
static
final
int
SOCKET_TIME_OUT
=
5
*
1000
;
// 超时时间
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment