File tree Expand file tree Collapse file tree 4 files changed +17
-4
lines changed
Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 3333## v2.2 升级日志
3434
3535- [x] 使用` go mod ` 方式管理程序的包依赖(建议二次开发的朋友把go开发环境升级到支持` go mod ` 的go版本)
36- - [x] APP下载单页管理
37- - [x] 书籍信息设置页,支持增加文字广告功能
36+ - [x] APP下载单页配置管理
37+ - [x] 书籍信息设置页,支持增加文字广告功能,并增加 APP 跳转页
3838- [x] 电子书是否登录才能下载
3939- [x] 移动端横幅尺寸控制(由于移动端横幅展示,为了不使横幅变形,以及能够灵活控制移动端横幅宽高比例显示)
4040- [x] 支持` 项目设置 ` 给项目内容增加全局文字小广告功能,比如添加原作者赞助二维码链接或者是原作者实体书购买地址等,以便支持开源作者
Original file line number Diff line number Diff line change 77 "strings"
88 "time"
99
10+ "github.com/TruthHun/BookStack/models"
11+
1012 "github.com/TruthHun/BookStack/models/store"
1113 "github.com/TruthHun/BookStack/utils"
1214 "github.com/astaxie/beego"
@@ -16,6 +18,14 @@ type StaticController struct {
1618 beego.Controller
1719}
1820
21+ func (this * StaticController ) APP () {
22+ link := strings .TrimSpace (models .GetOptionValue ("APP_PAGE" , "" ))
23+ if link != "" {
24+ this .Redirect (link , 302 )
25+ }
26+ this .Abort ("404" )
27+ }
28+
1929//静态文件,这个加在路由的最后
2030func (this * StaticController ) StaticFile () {
2131 file := this .GetString (":splat" )
Original file line number Diff line number Diff line change 77
88func webRouter () {
99 beego .Router ("/" , & controllers.CateController {}, "get:Index" )
10+ beego .Router ("/app" , & controllers.StaticController {}, "get:APP" )
1011 beego .Router ("/cate" , & controllers.CateController {}, "get:List" )
1112 //beego.Router("/", &controllers.HomeController{}, "*:Index")
1213 beego .Router ("/explore" , & controllers.HomeController {}, "*:Index" )
Original file line number Diff line number Diff line change 2121 < li > < a href ="https://www.bookstack.cn/read/help/opensource.md " title ="BookStack开源 " target ="_blank "> < i class ="fa fa-code "> </ i > 开源</ a > </ li >
2222 {{end}}
2323 {{if .APP_PAGE}}
24- < li > < a href ="{{.APP_PAGE}} " title ="手机APP下载 " target ="_blank "> < i class ="fa fa-paper-plane-o "> </ i > APP下载</ a > </ li >
24+ {{/* "/app" 会自动根据后台配置的APP单页地址跳转过去 */}}
25+ < li > < a href ="/app " title ="手机APP下载 " target ="_blank "> < i class ="fa fa-paper-plane-o "> </ i > APP下载</ a > </ li >
2526 {{end}}
2627 {{if gt .Member.MemberId 0}}
2728 < li >
8182 < li class ="hidden-sm "> < a href ="https://www.bookstack.cn/read/help/opensource.md " title ="BookStack开源 " target ="_blank "> < i class ="fa fa-code "> </ i > 开源</ a > </ li >
8283 {{end}}
8384 {{if .APP_PAGE}}
84- < li > < a href ="{{.APP_PAGE}} " title ="手机APP下载 " target ="_blank "> < i class ="fa fa-paper-plane-o "> </ i > APP下载</ a > </ li >
85+ {{/* "/app" 会自动根据后台配置的APP单页地址跳转过去 */}}
86+ < li > < a href ="/app " title ="手机APP下载 " target ="_blank "> < i class ="fa fa-paper-plane-o "> </ i > APP下载</ a > </ li >
8587 {{end}}
8688 {{if .IsSearch}}
8789 < li class ="active ">
You can’t perform that action at this time.
0 commit comments