随笔分类 - Beego
摘要:1 安装go-redis 2 // 安装命令 3 go get github.com/gomodule/redigo/redis 4 // 导入使用 5 import( 6 "github.com/gomodule/redigo/redis" 7 ) 8 // go操作redis文档 9 https
阅读全文
摘要:// User 用户表 type User struct { ID int UserName string Password string Articles []*Article `orm:"rel(m2m)"` } // Article 文章表 type Article struct { ID i
阅读全文
摘要:模板 this.Layout = "admin/layout.html" this.TplName = "admin/list.html" 在layout.html中必须有一下代码,才能显示list.html {{.Layout.Content}} LayoutSection this.Layout
阅读全文
摘要:// ShowLogin 登陆显示 func (c *UserController) ShowLogin() { username := c.Ctx.GetCookie("username") if username != "" { c.Data["username"] = username c.D
阅读全文
摘要:项目移植到另一台电脑后出现以下问题,及其解决方法: package models import ( "github.com/astaxie/beego/orm" _ "github.com/go-sql-driver/mysql" ) // User 用户表 type User struct { I
阅读全文

浙公网安备 33010602011771号