feat: 新增数据库
This commit is contained in:
@@ -9,7 +9,8 @@ import {
|
||||
extractCookieMetaFromSetCookie,
|
||||
extractCookieValueFromSetCookie,
|
||||
newApiFetchRaw,
|
||||
setNewApiAuthCookies
|
||||
setNewApiAuthCookies,
|
||||
upsertUserSnapshot
|
||||
} from "~~/server/utils";
|
||||
|
||||
interface INewApiWrappedLoginResponse {
|
||||
@@ -92,6 +93,10 @@ export default defineEventHandler(async (event) => {
|
||||
extractCookieMetaFromSetCookie(result.headers, "session")
|
||||
);
|
||||
|
||||
upsertUserSnapshot(normalized.user).catch((error) => {
|
||||
consola.error("/api/auth/login 保存用户快照失败", error);
|
||||
});
|
||||
|
||||
return createSuccessResponse<IUserLoginData>(
|
||||
normalized.user,
|
||||
normalized.message
|
||||
|
||||
Reference in New Issue
Block a user