fix: ts数据
This commit is contained in:
@@ -46,6 +46,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
||||
// 根据 id 获取用户信息
|
||||
const user = await User.findById(response._id);
|
||||
|
||||
if (!user) {
|
||||
throw new Error('获取用户信息异常');
|
||||
}
|
||||
|
||||
jsonRes(res, {
|
||||
data: {
|
||||
token: generateToken(user._id),
|
||||
|
||||
@@ -44,6 +44,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
||||
email
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
throw new Error('获取用户信息异常');
|
||||
}
|
||||
|
||||
jsonRes(res, {
|
||||
data: {
|
||||
token: generateToken(user._id),
|
||||
|
||||
Reference in New Issue
Block a user