作者 tangxvhui

启用用户鉴权

package command
import "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/lib"
import (
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/lib"
)
type UpdateOrderCommand struct {
//id
... ... @@ -41,5 +43,6 @@ func (command UpdateOrderCommand) ValidateCommand() error {
if len(command.OrderRegion) == 0 {
return lib.ThrowError(lib.ARG_ERROR, "订单区域必填")
}
return nil
}
... ...
... ... @@ -31,7 +31,7 @@ type Order struct {
//订单已支付金额(货款)
OrderPaymentAmount float64
//最后分红状态
BonusStatus int
BonusStatus int `pg:",default:1"`
//订单区域信息
OrderRegionInfo domain.RegionInfo
... ... @@ -51,6 +51,7 @@ type Order struct {
//上一次查看时间 已读情况
LastViewTime time.Time
//最后分红状态
}
var _ pg.BeforeUpdateHook = (*Order)(nil)
... ...
... ... @@ -117,8 +117,8 @@ func (controller *BaseController) GetHeaderToken() string {
}
func (controller *BaseController) ValidJWTToken() bool {
controller.setUserId(2)
return true
// controller.setUserId(2)
// return true
headerToken := controller.GetHeaderToken()
mytoken := new(lib.MyToken)
... ...