|
|
@ -9,29 +9,23 @@ import ( |
|
|
|
) |
|
|
|
|
|
|
|
func NewDomainToken(c *gin.Context, id int64, xid string, remeber bool) (string, error) { |
|
|
|
/*var dms string |
|
|
|
if comm.REG_Host.MatchString(c.Req.Host) { |
|
|
|
strs := comm.REG_Host.FindAllStringSubmatch(c.Req.Host, 1)[0] |
|
|
|
var dms string |
|
|
|
/*if comms.RegHost.MatchString(c.Request.Host) { |
|
|
|
strs := comms.RegHost.FindAllStringSubmatch(c.Request.Host, 1)[0] |
|
|
|
dms = strs[3] |
|
|
|
} |
|
|
|
logrusInfo("NewDomainToken.dms=" + dms) |
|
|
|
return gocloud.SetToken(c, &jwt.MapClaims{ |
|
|
|
"id": fmt.Sprintf("%d", id), |
|
|
|
"xid": xid, |
|
|
|
"times": time.Now(), |
|
|
|
}, remeber, dms)*/ |
|
|
|
logrus.Info("NewDomainToken.dms=" + dms)*/ |
|
|
|
return gocloud.SetToken(c, jwt.MapClaims{ |
|
|
|
"id": fmt.Sprintf("%d", id), |
|
|
|
"xid": xid, |
|
|
|
"times": time.Now(), |
|
|
|
}, remeber) |
|
|
|
}, remeber, dms) |
|
|
|
} |
|
|
|
func ClearDomainToken(c *gin.Context) error { |
|
|
|
/*var dms string |
|
|
|
if comm.REG_Host.MatchString(c.Req.Host) { |
|
|
|
strs := comm.REG_Host.FindAllStringSubmatch(c.Req.Host, 1)[0] |
|
|
|
var dms string |
|
|
|
/*if comms.RegHost.MatchString(c.Request.Host) { |
|
|
|
strs := comms.RegHost.FindAllStringSubmatch(c.Request.Host, 1)[0] |
|
|
|
dms = strs[3] |
|
|
|
} |
|
|
|
return gocloud.ClearToken(c, dms)*/ |
|
|
|
return gocloud.ClearToken(c) |
|
|
|
}*/ |
|
|
|
return gocloud.ClearToken(c, dms) |
|
|
|
} |