|
@@ -4,7 +4,7 @@ import { UserServiceMt } from '../../../user-module-mt/src/services/index.mt';
|
|
|
import { AppDataSource } from '@d8d/shared-utils';
|
|
import { AppDataSource } from '@d8d/shared-utils';
|
|
|
import { AuthContext } from '@d8d/shared-types';
|
|
import { AuthContext } from '@d8d/shared-types';
|
|
|
import { parseWithAwait } from '@d8d/shared-utils';
|
|
import { parseWithAwait } from '@d8d/shared-utils';
|
|
|
-import { UserSchemaMt } from '../../../user-module-mt/src/schemas/index.mt';
|
|
|
|
|
|
|
+import { UserResponseSchemaMt } from '../../../user-module-mt/src/schemas/index.mt';
|
|
|
|
|
|
|
|
export async function authMiddleware(c: Context<AuthContext>, next: Next) {
|
|
export async function authMiddleware(c: Context<AuthContext>, next: Next) {
|
|
|
try {
|
|
try {
|
|
@@ -36,7 +36,7 @@ export async function authMiddleware(c: Context<AuthContext>, next: Next) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 设置用户上下文
|
|
// 设置用户上下文
|
|
|
- const userData = await parseWithAwait(UserSchemaMt, user);
|
|
|
|
|
|
|
+ const userData = await parseWithAwait(UserResponseSchemaMt, user);
|
|
|
c.set('user', userData);
|
|
c.set('user', userData);
|
|
|
c.set('token', token);
|
|
c.set('token', token);
|
|
|
|
|
|