From ebd5df8eca24f73685f57d58763bd4e94643da16 Mon Sep 17 00:00:00 2001 From: Kerwin Date: Tue, 23 May 2023 13:51:51 +0800 Subject: [PATCH] fix: admin role error (Close #158) --- service/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/index.ts b/service/src/index.ts index b3cc788c..1811b409 100644 --- a/service/src/index.ts +++ b/service/src/index.ts @@ -588,7 +588,7 @@ router.post('/user-login', async (req, res) => { avatar: user.avatar, description: user.description, userId: user._id, - root: !user.roles.includes(UserRole.Admin), + root: user.roles.includes(UserRole.Admin), config: user.config, }, config.siteConfig.loginSalt.trim()) res.send({ status: 'Success', message: '登录成功 | Login successfully', data: { token } })