master
huanghai 5 years ago
parent 53d660eb32
commit 67710c521c

@ -94,6 +94,14 @@ func init() {
2020-03-16
*/
func IsLegal(c *gin.Context) (bool, ResultStruct) {
//植入一个写入未登录用户访问时记录浏览器ID或者机器ID的方法
_, err := c.Request.Cookie("browser_id")
if err == nil {
//读取到
} else {
//没有设置过
c.SetCookie("browser_id", CommonUtil.GetUUID(), -1, "/", "", false, true)
}
//纯接口名称不要get后面的参数
jkName := strings.Split(c.Request.RequestURI, "?")[0]
//0、长度检查

Loading…
Cancel
Save