mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 11:47:36 +08:00
[REV]Update sql
This commit is contained in:
parent
b563245ed1
commit
22f5f0f887
@ -113,7 +113,7 @@ func (c *CloudAction) CertDispatcher(gt *api_model.GetUserToken) ([]byte, []byte
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
keyFile = keyFile.(rsa.PrivateKey)
|
||||
//keyFile = keyFile.(rsa.PrivateKey)
|
||||
|
||||
validHourTime := (gt.Body.ValidityPeriod - gt.Body.BeforeTime)
|
||||
cer := &x509.Certificate{
|
||||
|
@ -83,8 +83,9 @@ func CreateDefaultTokenMap(conf option.Config) {
|
||||
APIRange: "all",
|
||||
ValidityPeriod: 3257894000,
|
||||
}
|
||||
defaultTokenMap := make(map[string]*dbmodel.RegionUserInfo)
|
||||
defaultTokenMap[consoleToken] = rui
|
||||
tokenMap := make(map[string]*dbmodel.RegionUserInfo)
|
||||
tokenMap[consoleToken] = rui
|
||||
defaultTokenMap = tokenMap
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ func (t *RegionUserInfoDaoImpl) GetTokenByEid(eid string) (*model.RegionUserInfo
|
||||
func (t *RegionUserInfoDaoImpl) GetALLTokenInValidityPeriod() ([]*model.RegionUserInfo, error) {
|
||||
var ruis []*model.RegionUserInfo
|
||||
timestamp := int(time.Now().Unix())
|
||||
if err := t.DB.Select("api_range", "validity_period", "token").Where("validity_period > ?", timestamp).Find(&ruis).Error; err != nil {
|
||||
if err := t.DB.Select("api_range, validity_period, token").Where("validity_period > ?", timestamp).Find(&ruis).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ruis, nil
|
||||
|
Loading…
Reference in New Issue
Block a user