feat(user): upload avatars through multipart endpoint#3302
Merged
Conversation
386ea79 to
7f5fb8d
Compare
7f5fb8d to
e77ff8c
Compare
nighca
approved these changes
Jun 25, 2026
| if (blob.size > maxAvatarFileSize) { | ||
| throw new DefaultException({ | ||
| en: 'Avatar image must be 5 MiB or smaller', | ||
| zh: '头像图片不能超过 5 MiB' |
Collaborator
There was a problem hiding this comment.
Nit: 发现这里原来的提示文案是 MiB,其他地方(复用的 humanizeFileSize)应该都是 KB/MB/...;按理说 MiB 会准确一些,不过对用户可能会增加理解成本,有点纠结,我建个单独的 issue 跟下这个吧
This comment was marked as low quality.
This comment was marked as low quality.
Sorry, something went wrong.
Member
Author
There was a problem hiding this comment.
哦用 MiB 这种算是我的个人习惯吧,这里没注意,不过我倒是也能接受面对普通用户用 MB
Collaborator
There was a problem hiding this comment.
我看用 MB 也有 1024/1000 的争议;那可以这里先跟其他地方一样统一为 MB(1024),要不要换 1000 或者换单位再统一看
Member
Author
There was a problem hiding this comment.
文案上我觉得用 MB/MiB 都还好,但具体实现上我建议不要统一成 1000,这个太别扭了
Member
Author
There was a problem hiding this comment.
https://github.com/goplus/builder/compare/e77ff8c2668e5f65e76f97926f74806894623779..85202a6c3eec7f04f5b00c63a3007d77887d7a64 我先给统一了一下,前端文案上统一用 MB,api spec 文案上用 MiB
5 tasks
Move signed-in user avatar updates out of profile patch requests and onto the dedicated `/user/avatar` multipart upload endpoint. Keep profile patches scoped to text fields and refresh the signed-in user after avatar upload so callers receive the updated avatar URL. Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
e77ff8c to
85202a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move signed-in user avatar updates out of profile patch requests and onto the dedicated
/user/avatarmultipart upload endpoint.Keep profile patches scoped to text fields and refresh the signed-in user after avatar upload so callers receive the updated avatar URL.