New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for user avatar upload #4253
Conversation
本地尝试了一下,有几个建议:
|
/retitle refactor:add support for user avatar upload |
Codecov Report
@@ Coverage Diff @@
## main #4253 +/- ##
============================================
+ Coverage 60.13% 60.16% +0.02%
- Complexity 2407 2422 +15
============================================
Files 364 364
Lines 12584 12701 +117
Branches 903 915 +12
============================================
+ Hits 7568 7642 +74
- Misses 4575 4609 +34
- Partials 441 450 +9
|
/hold 缺少修改其他用户头像的方式 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 用户头像的文件名建议用 UUID 替代。
- 删除头像时建议增加确认步骤。
- 期望拥有用户管理权限的用户能够操作其他用户头像。
已对功能进行补充,并且完善了移动端样式。 |
application/src/main/java/run/halo/app/core/extension/endpoint/UserEndpoint.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @LIlGG , PTAL
application/src/main/java/run/halo/app/core/extension/endpoint/UserEndpoint.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang, ruibaby The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
#### What type of PR is this? /kind bug /area core #### What this PR does / why we need it: 解决 #4253 所导致的用户旧头像被删除的问题。 #### Special notes for your reviewer: 1. 使用 2.7.x 之前的 Halo 版本,新建用户并设置其头像。 2. 升级 Halo 至 2.8.0-rc.1 3. 头像还存在即可。 4. 测试头像上传、移除功能是否正常可用。 #### Does this PR introduce a user-facing change? ```release-note None ```
What type of PR is this?
/kind improvement
/area console
/area core
What this PR does / why we need it:
此 PR 对用户头像上传的方式进行了重构,移除了原有的头像链接及上传至附件库的方案。允许具有用户管理权限的用户对其他用户的头像进行修改和移除。
Core:
新增了
/apis/api.console.halo.run/v1alpha1/users/-/avatar
的POST
以及DELETE
接口,用来上传用户的头像及删除当前用户的头像。Console:
新增对用户头像进行裁剪的功能,并调用上传接口保存用户头像。
需等待 #4247 合并
Which issue(s) this PR fixes:
Fixes #2688
See #4251
See #4247
Special notes for your reviewer:
Does this PR introduce a user-facing change?