diff --git a/controllers/book.go b/controllers/book.go index a2c9ca87..cc7736e8 100644 --- a/controllers/book.go +++ b/controllers/book.go @@ -503,6 +503,7 @@ func (c *BookController) Create() { } c.JsonResult(6001, "error") } + //导入 func (c *BookController) Import() { @@ -515,6 +516,12 @@ func (c *BookController) Import() { beego.Info(moreFile.Filename) + ext := filepath.Ext(moreFile.Filename) + + if !strings.EqualFold(ext,".doc") || !strings.EqualFold(ext,".docx") { + c.JsonResult(6004,"不支持的文件类型") + } + tempPath := filepath.Join(os.TempDir(),c.CruSession.SessionID()) os.MkdirAll(tempPath,0766) @@ -525,7 +532,6 @@ func (c *BookController) Import() { converter.Resolve(tempPath) - } // CreateToken 创建访问来令牌. diff --git a/controllers/manager.go b/controllers/manager.go index 99f97aaf..63d85d2a 100644 --- a/controllers/manager.go +++ b/controllers/manager.go @@ -435,7 +435,7 @@ func (c *ManagerController) Setting() { c.Data["SITE_TITLE"] = c.Option["SITE_NAME"] for _, item := range options { - c.Data[item.OptionName] = item + c.Data[item.OptionName] = item.OptionValue } } diff --git a/converter/param_linux.go b/converter/param_linux.go deleted file mode 100644 index b94c4743..00000000 --- a/converter/param_linux.go +++ /dev/null @@ -1,5 +0,0 @@ -package converter - -func GetFooterOrHeaderParams(v string) string { - return "" + v +"" -} diff --git a/converter/param_windows.go b/converter/param_windows.go deleted file mode 100644 index 76becb65..00000000 --- a/converter/param_windows.go +++ /dev/null @@ -1,5 +0,0 @@ -package converter - -func GetFooterOrHeaderParams(v string) string { - return v -} \ No newline at end of file diff --git a/models/options.go b/models/options.go index bf6413df..d02cd735 100644 --- a/models/options.go +++ b/models/options.go @@ -154,6 +154,15 @@ func (m *Option) Init() error { } } + if !o.QueryTable(m.TableNameWithPrefix()).Filter("option_name", "site_beian").Exist() { + option := NewOption() + option.OptionValue = "" + option.OptionName = "site_beian" + option.OptionTitle = "域名备案" + if _, err := o.Insert(option); err != nil { + return err + } + } return nil } diff --git a/static/css/main.css b/static/css/main.css index 822d0ed7..be7df6b6 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -611,22 +611,22 @@ textarea{ } .footer .container .row{ margin-left: 220px; - border-top: 2px solid #DDDDD9; padding-top: 20px; opacity : 0.8; font-size: 13px; } +.footer .container .border-top{ + border-top: 2px solid #DDDDD9; +} .manual-container .footer .container .row{ margin-left: 0; } -.footer li { - display: inline-block; -} -.footer li a{ + +.footer a{ color: #222; text-decoration: none; } -.footer li a:hover { +.footer a:hover { color: #2b85ae } @media screen and (max-width: 840px) { diff --git a/views/manager/setting.tpl b/views/manager/setting.tpl index a32d0a54..46d82a80 100644 --- a/views/manager/setting.tpl +++ b/views/manager/setting.tpl @@ -43,23 +43,27 @@