fix: ts数据

This commit is contained in:
archer
2023-03-26 10:51:47 +08:00
parent 1cbcc62494
commit e289c4ec53
4 changed files with 11 additions and 3 deletions

View File

@@ -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),

View File

@@ -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),