feat(server): 添加用户信息获取逻辑
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { Express } from "express";
|
||||
import {userInfoMiddleware} from "@/middleware/auth";
|
||||
|
||||
export const createApis = (app: Express) => {
|
||||
app.get("/api/test", async (req, res) => {
|
||||
app.get("/api/test", userInfoMiddleware, async (req, res) => {
|
||||
console.log(req.userInfo);
|
||||
res.status(200).json({
|
||||
message: "success",
|
||||
data: null,
|
||||
|
||||
Reference in New Issue
Block a user