1 Star 0 Fork 0

fcourage/ContentManagementSystem

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.go 647 Bytes
一键复制 编辑 原始数据 按行查看 历史
Fcou 提交于 2020-07-05 09:34 . No commit message
package main
import (
_ "ContentManagementSystem/routers"
"github.com/astaxie/beego"
)
func main() {
beego.BConfig.WebConfig.Session.SessionOn = true
beego.AddFuncMap("PrePageIndex", prePageIndex) //视图函数注册
beego.AddFuncMap("NextPageIndex", nextPageIndex) //视图函数注册
beego.Run()
}
// prePageIndex 视图函数,index.html的51行上一页功能,将页面-1
func prePageIndex(pageIndex int) int {
pageIndex--
if pageIndex < 1 {
pageIndex = 1
}
return pageIndex
}
// nextPageIndex 视图函数,index.html的56行下一页功能,将页面+1
func nextPageIndex(pageIndex int) int {
return pageIndex + 1
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/fcourage/ContentManagementSystem.git
git@gitee.com:fcourage/ContentManagementSystem.git
fcourage
ContentManagementSystem
ContentManagementSystem
master

搜索帮助