Skip to content

Commit afdcfc1

Browse files
committed
初始化数据
1 parent 1caf079 commit afdcfc1

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

controllers/HomeControllers/ViewController.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (this *ViewController) Get() {
6161
this.Data["PageId"] = "wenku-content"
6262
this.Data["Doc"] = doc
6363
pages := helper.Interface2Int(doc["Page"])
64-
PageShow := 5 //TODO 刚开始显示供浏览的页数,后面需要设置为后台可控
64+
PageShow := 5
6565
if pages > PageShow {
6666
this.Data["PreviewPages"] = make([]string, PageShow)
6767
} else {

models/Install.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ func installSys() {
7070
TimeExpireRelate: 604800,
7171
}
7272
beego.Info("初始化系统数据")
73-
if _, _, err := O.ReadOrCreate(&sys, "Id"); err != nil {
74-
helper.Logger.Error("初始化系统数据失败:" + err.Error())
75-
}
73+
O.ReadOrCreate(&sys, "Id")
7674
}
7775

7876
//安装友链初始数据
@@ -276,9 +274,7 @@ func installSeo() {
276274
Description: "{description}",
277275
},
278276
}
279-
if _, err := O.InsertMulti(len(seos), &seos); err != nil {
280-
helper.Logger.Error("初始化SEO数据失败:" + err.Error())
281-
}
277+
O.InsertMulti(len(seos), &seos)
282278
}
283279

284280
//安装分类初始数据

0 commit comments

Comments
 (0)