diff --git a/app/model/conf.go b/app/model/conf.go index a7608eb..d94c76c 100644 --- a/app/model/conf.go +++ b/app/model/conf.go @@ -3,6 +3,7 @@ package model import ( "fmt" "os" + "strings" "sync" "time" @@ -107,7 +108,7 @@ func CheckoutCounter(host, id string) string { func ConfInit() { var hash = utils.StrSha256(utils.Md5String(time.Now().String())) var secure = "/" + hash[:10] - var token = utils.Md5String(hash[18:28]) + var token = strings.ToUpper(utils.Md5String(hash[18:28])) var username = hash[10:20] var password = hash[20:30] var encrypt, _ = bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) diff --git a/app/model/order.go b/app/model/order.go index 9416f47..f348a9a 100644 --- a/app/model/order.go +++ b/app/model/order.go @@ -73,7 +73,7 @@ type Order struct { NotifyNum int `gorm:"column:notify_num;type:int(11);not null;default:0;comment:回调次数" json:"notify_num"` NotifyState int `gorm:"column:notify_state;type:tinyint(1);not null;default:0;comment:回调状态 1:成功 0:失败" json:"notify_state"` RefHash string `gorm:"column:ref_hash;type:varchar(128);not null;default:'';index;comment:交易哈希" json:"ref_hash"` - RefBlockNum int64 `gorm:"column:ref_block_num;type:bigint(20);not null;default:0;comment:区块索引" json:"ref_block_num"` + RefBlockNum int64 `gorm:"column:ref_block_num;type:varchar(64);not null;default:0;comment:区块索引" json:"ref_block_num"` ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;not null;comment:失效时间" json:"expired_at"` ConfirmedAt *time.Time `gorm:"column:confirmed_at;type:datetime;not null;comment:交易确认时间" json:"confirmed_at"` AutoTimeAt