From 62168979e3563965f1a819443ae6955fcf4a0471 Mon Sep 17 00:00:00 2001 From: whyour Date: Fri, 22 Dec 2023 22:13:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/user.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/back/services/user.ts b/back/services/user.ts index b2297081..227fc180 100644 --- a/back/services/user.ts +++ b/back/services/user.ts @@ -242,13 +242,13 @@ export default class UserService { if (password === 'admin') { return { code: 400, message: '密码不能设置为admin' }; } - const authInfo = this.getAuthInfo(); + const authInfo = await this.getAuthInfo(); this.updateAuthInfo(authInfo, { username, password }); return { code: 200, message: '更新成功' }; } public async updateAvatar(avatar: string) { - const authInfo = this.getAuthInfo(); + const authInfo = await this.getAuthInfo(); this.updateAuthInfo(authInfo, { avatar }); return { code: 200, data: avatar, message: '更新成功' }; } @@ -264,7 +264,7 @@ export default class UserService { }), ); } - return this.getAuthInfo(); + return await this.getAuthInfo(); } public async initTwoFactor() { @@ -317,8 +317,8 @@ export default class UserService { } } - public deactiveTwoFactor() { - const authInfo = this.getAuthInfo(); + public async deactiveTwoFactor() { + const authInfo = await this.getAuthInfo(); this.updateAuthInfo(authInfo, { twoFactorActivated: false, twoFactorActived: false,