![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
beego
DyanWang
这个作者很懒,什么都没留下…
展开
-
Beego 中使用redis
conf中redis相关配置##redis连接信息redisHost = "127.0.0.1"redisPort = "6379"redisPass = ""redisDB = 0redisPrefix = "UIMS_PERMISSION_"Model中redis初始化:import ( "github.com/astaxie/beego" "github.com/astaxie/beego/logs" "github.com/astaxie/beego/orm"原创 2020-12-21 14:14:44 · 1217 阅读 · 2 评论 -
Beego 使用redis Cache
配置档中增加 redis 相关配置 ##redis连接信息redisHost = "127.0.0.1"redisPort = "6379"redisPass = ""redisDB = 0 初始化,创建Cache对象:cacheRedisConn,_ := json.Marshal(map[string]string { "key" : "redisCache", "conn" : beego.AppConfig.String("redisHost")+":"+..原创 2020-12-21 14:06:43 · 837 阅读 · 0 评论 -
Beego 请求参数获取
路由匹配对应参数://path 参数fmt.Println(this.Ctx.Input.Param(":splat"))路由URIuri := this.Ctx.Input.URI();ctx.Input.URL() //不带参数访问方式method := this.Ctx.Input.Method()除raw之外的参数param := this.Input()for k, _ := range param { req.Param(k, param.Get(k))原创 2020-12-21 14:03:39 · 1316 阅读 · 0 评论 -
Beego 中使用 jwt
包引入github.com/dgrijalva/jwt-goutils目录下编写Jwt.gopackage utilsimport ( // "crypto/md5" "fmt" "github.com/astaxie/beego/logs" // "github.com/3xxx/go-sso/models" "github.com/astaxie/beego" // "github.com/astaxie/beego/orm" "str.原创 2020-12-21 14:01:04 · 1197 阅读 · 0 评论 -
Beego 中使用casbin
安装go get github.com/casbin/casbin/v2安装 ORM 适配器,采用DB方式策略go get github.com/casbin/beego-orm-adapter/v2开发: 添加对应的model 文件 编写对应的Casbin 文件 import ( "github.com/astaxie/beego/logs" beegoormadapter "github.com/casbin/beego-orm-adapter/v2原创 2020-12-21 13:55:08 · 516 阅读 · 0 评论