feat: 完成用户登录界面,api还需完善

This commit is contained in:
539943419 committed 2025-01-14 02:10:39 +08:00
1 parent 4c69f57aaa
commit d7dcc473a9
18 files changed
+681 -129

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@ import jwt from "jsonwebtoken"
import getKey from "./getKey"
export default function createToken(userId: number): string {
export default function createToken(payload: { userId: number, password: string, username: string }): string {
const key = getKey()
return jwt.sign({ userId }, key, { expiresIn: '168h' })
return jwt.sign(payload, key, { expiresIn: '168h' })
}