Skip to content

Commit 32344d0

Browse files
committed
opt account uniq
1 parent 87e196e commit 32344d0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

apis/user.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ func SetLoginAccount(ctx *gin.Context) {
3838
return
3939
}
4040
code := services.SetUserAccount(ctxs.ToCtx(ctx), req)
41-
responses.SuccessHttpResp(ctx, code)
41+
if code != errs.IMErrorCode_SUCCESS {
42+
responses.ErrorHttpResp(ctx, code)
43+
return
44+
}
45+
responses.SuccessHttpResp(ctx, nil)
4246
}
4347

4448
func UpdateUser(ctx *gin.Context) {

services/userservice.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ func GetUser(ctx context.Context, userId string) *apimodels.UserObj {
316316
u.Avatar = user.UserPortrait
317317
u.UserType = user.UserType
318318
u.Pinyin = user.Pinyin
319+
u.Account = user.LoginAccount
319320
}
320321
return u
321322
}

0 commit comments

Comments
 (0)