修改命令

pull/25/merge
Minho 2017-05-03 16:03:51 +08:00
parent 91c7707a1f
commit d02aad28b9
2 changed files with 7 additions and 7 deletions

View File

@ -86,8 +86,8 @@ func Initialization() {
member.Email = "admin@iminho.me"
if err := member.Add();err != nil {
fmt.Println(err)
os.Exit(1)
panic(err)
os.Exit(0)
}
book := models.NewBook()
@ -108,8 +108,8 @@ func Initialization() {
book.Theme = "default"
if err := book.Insert(); err != nil {
beego.Error(err)
os.Exit(1)
panic(err)
os.Exit(0)
}
}
@ -142,8 +142,8 @@ func RegisterCommand() {
f, _ := os.Create("install.lock")
defer f.Close()
}else{
logs.Info("初始化数据库失败 =>",err)
os.Exit(2)
panic(err.Error())
os.Exit(0)
}
}

View File

@ -70,7 +70,7 @@ func (c *SearchController) Index() {
src = re.ReplaceAllString(src, "\n")
r := []rune(src)
beego.Info(r)
if len(r) > 100 {
src = string(r[:100])
}else{