feat: 完成用户登录界面,api还需完善
This commit is contained in:
1 parent
4c69f57aaa
commit
d7dcc473a9
18 files changed
+681
-129
No files matched your search
@@ -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' })
|
||||
}
|
||||
Reference in new issue
Block a user