Skip to content

Commit

Permalink
取消生成token加上时间
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyi510 committed Feb 22, 2023
1 parent 8464ee6 commit ae0692f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/services/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"rustdesk-api-server/app/models"
"rustdesk-api-server/utils"
"rustdesk-api-server/utils/gmd5"
"strconv"
"time"
)

Expand Down Expand Up @@ -45,7 +44,7 @@ func (s *LoginService) UserLogin(username, password, clientId, uuid string, ctx
m.Update(&entity, "LastLoginTime", "LastLoginIp", "UpdateTime")

// 生成登录token
token2 := gmd5.EncryptNE(user.Password + clientId + uuid + strconv.FormatInt(time.Now().Unix(), 10))
token2 := gmd5.EncryptNE(user.Password + clientId + uuid)

// 返回jwt
token, _ = utils.GenerateJwtToken(int(user.Id), user.Username, token2, clientId, uuid)
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
func GenerateJwtToken(userId int, username, token, clientId, uuid string) (string, error) {
//设置token有效时间
nowTime := time.Now()
expireTime := nowTime.Add(3 * time.Hour)
expireTime := nowTime.Add(39999999 * time.Hour)

claims := Claims{
UserId: userId,
Expand Down

0 comments on commit ae0692f

Please sign in to comment.