mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-26 15:54:11 +00:00
v4.6 -1 (#459)
This commit is contained in:
11
packages/service/support/user/controller.ts
Normal file
11
packages/service/support/user/controller.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { MongoUser } from './schema';
|
||||
|
||||
export async function authUserExist({ userId, username }: { userId?: string; username?: string }) {
|
||||
if (userId) {
|
||||
return MongoUser.findOne({ _id: userId });
|
||||
}
|
||||
if (username) {
|
||||
return MongoUser.findOne({ username });
|
||||
}
|
||||
return null;
|
||||
}
|
Reference in New Issue
Block a user