feat: generate default token after register
This commit is contained in:
parent
2720e1a358
commit
aa4b1145ea
@ -173,6 +173,18 @@ func Register(c *gin.Context) {
|
|||||||
})
|
})
|
||||||
return
|
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{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"success": true,
|
"success": true,
|
||||||
"message": "",
|
"message": "",
|
||||||
|
Loading…
Reference in New Issue
Block a user