Skip to content

Commit

Permalink
初始化数据
Browse files Browse the repository at this point in the history
  • Loading branch information
TruthHun88 committed Jul 8, 2018
1 parent 1caf079 commit afdcfc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion controllers/HomeControllers/ViewController.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (this *ViewController) Get() {
this.Data["PageId"] = "wenku-content"
this.Data["Doc"] = doc
pages := helper.Interface2Int(doc["Page"])
PageShow := 5 //TODO 刚开始显示供浏览的页数,后面需要设置为后台可控
PageShow := 5
if pages > PageShow {
this.Data["PreviewPages"] = make([]string, PageShow)
} else {
Expand Down
8 changes: 2 additions & 6 deletions models/Install.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ func installSys() {
TimeExpireRelate: 604800,
}
beego.Info("初始化系统数据")
if _, _, err := O.ReadOrCreate(&sys, "Id"); err != nil {
helper.Logger.Error("初始化系统数据失败:" + err.Error())
}
O.ReadOrCreate(&sys, "Id")
}

//安装友链初始数据
Expand Down Expand Up @@ -276,9 +274,7 @@ func installSeo() {
Description: "{description}",
},
}
if _, err := O.InsertMulti(len(seos), &seos); err != nil {
helper.Logger.Error("初始化SEO数据失败:" + err.Error())
}
O.InsertMulti(len(seos), &seos)
}

//安装分类初始数据
Expand Down

0 comments on commit afdcfc1

Please sign in to comment.