mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
0.8.5 后端配合前端路由,设定自动跳转改善使用体验
This commit is contained in:
parent
d5172b9d5f
commit
10b74007c6
@ -177,6 +177,10 @@ func main() {
|
||||
- [ ] 集群支持动态删减节点(或是页面管理删除)
|
||||
|
||||
|
||||
### 版本`0.8.5`
|
||||
|
||||
- [x] 后端配合前端路由,设定自动跳转改善使用体验
|
||||
|
||||
### 版本`0.8.4`
|
||||
|
||||
- [x] 代码整理优化,前后端升级依赖包
|
||||
|
||||
@ -93,7 +93,11 @@ func Run() {
|
||||
method := cmn.ToUpper(c.Request.Method)
|
||||
handle := getHttpController(method, path)
|
||||
if handle == nil {
|
||||
c.JSON(http.StatusNotFound, Error404())
|
||||
if cmn.Contains(path, ".") {
|
||||
c.JSON(http.StatusNotFound, Error404()) // 有后缀名的文件请求,找不到则404
|
||||
} else {
|
||||
req.Redirect(conf.GetContextPath() + "/") // 默认统一跳转大到[/glc/]
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -22,14 +22,8 @@ func Run() {
|
||||
// 过滤器
|
||||
gweb.RegisterFilter(filter.CrossFilter)
|
||||
|
||||
// 控制器(跳转)
|
||||
gweb.RegisterController(method.GET, "/", html.RedirectToHomeController) // 自动跳转
|
||||
gweb.RegisterController(method.GET, contextPath, html.RedirectToHomeController) // 自动跳转
|
||||
gweb.RegisterController(method.GET, contextPath+"/search", html.RedirectToHomeController) // 自动跳转
|
||||
gweb.RegisterController(method.GET, contextPath+"/storages", html.RedirectToHomeController) // 自动跳转
|
||||
|
||||
// Html静态文件
|
||||
gweb.RegisterController(method.GET, contextPath+"/", html.HomeIndexHtmlController)
|
||||
gweb.RegisterController(method.GET, contextPath+"/", html.HomeIndexHtmlController) // [响应/glc/]
|
||||
gweb.RegisterController(method.GET, "/**/*.html", html.StaticFileController)
|
||||
gweb.RegisterController(method.GET, "/**/*.css", html.StaticFileController)
|
||||
gweb.RegisterController(method.GET, "/**/*.js", html.StaticFileController)
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
package onstart
|
||||
|
||||
const VERSION = "glogcenter 0.8.4"
|
||||
const VERSION = "glogcenter 0.8.5"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user