From 2444b5cacc66ce5cb7bb24a1e5d00e6c48f28736 Mon Sep 17 00:00:00 2001 From: xmdhs Date: Fri, 6 Oct 2023 01:42:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E5=90=8E=E5=88=A0=E9=99=A4=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/user.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service/user.go b/service/user.go index 7058d5b..b6011dc 100644 --- a/service/user.go +++ b/service/user.go @@ -140,7 +140,7 @@ func (w *WebService) ChangePasswd(ctx context.Context, p model.ChangePasswd, tok return nil } -func (w *WebService) changeName(ctx context.Context, newName string, uid int) error { +func (w *WebService) changeName(ctx context.Context, newName string, uid int, uuid string) error { if w.config.OfflineUUID { return fmt.Errorf("changeName: %w", ErrChangeName) } @@ -155,6 +155,7 @@ func (w *WebService) changeName(ctx context.Context, newName string, uid int) er if err != nil { return fmt.Errorf("changeName: %w", err) } + w.cache.Del([]byte("Profile" + uuid)) return err } @@ -163,7 +164,7 @@ func (w *WebService) ChangeName(ctx context.Context, newName string, token strin if err != nil { return fmt.Errorf("ChangeName: %w", err) } - err = w.changeName(ctx, newName, t.UID) + err = w.changeName(ctx, newName, t.UID, t.Subject) if err != nil { return fmt.Errorf("ChangeName: %w", err) }