feat: generate default token after register

This commit is contained in:
carey036 2024-04-30 18:12:50 +08:00
parent 2720e1a358
commit aa4b1145ea

View File

@ -173,6 +173,18 @@ func Register(c *gin.Context) {
})
return
}
user.ValidateAndFill()
cleanToken := model.Token{
UserId: user.Id,
Name: "default",
Key: random.GenerateKey(),
CreatedTime: 0,
AccessedTime: 0,
ExpiredTime: -1,
RemainQuota: -1,
UnlimitedQuota: true,
}
cleanToken.Insert()
c.JSON(http.StatusOK, gin.H{
"success": true,
"message": "",