关于login重构

This commit is contained in:
2025-03-21 20:41:01 +08:00
parent 0179fe73a3
commit 8053a3db64
28 changed files with 889 additions and 596 deletions

View File

@@ -143,6 +143,7 @@ app
path: 'org',
key: 'hasUser',
middleware: ['auth'],
description: '判断当前username这个组织是否在当前用户的组织中。如果有返回当前组织的用户信息否则返回null',
})
.define(async (ctx) => {
const tokenUser = ctx.state.tokenUser;
@@ -159,7 +160,13 @@ app
};
return;
}
const usernameUser = await User.findOne({ where: { username } });
const usernameUser = await User.findOne({
where: { username },
attributes: {
exclude: ['password', 'salt'],
},
});
if (!usernameUser) {
ctx.body = {
uid: null,