mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: use history router mode
This commit is contained in:
@@ -91,7 +91,7 @@ func OneDriveOAuth(c *gin.Context) {
|
||||
queries.Add("msg", res.Msg)
|
||||
queries.Add("err", res.Error)
|
||||
redirect.RawQuery = queries.Encode()
|
||||
c.Redirect(301, "/#"+redirect.String())
|
||||
c.Redirect(301, "/"+redirect.String())
|
||||
} else {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"github.com/cloudreve/Cloudreve/v3/bootstrap"
|
||||
"github.com/cloudreve/Cloudreve/v3/middleware"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/conf"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/hashid"
|
||||
@@ -9,7 +8,6 @@ import (
|
||||
"github.com/cloudreve/Cloudreve/v3/routers/controllers"
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gin-contrib/gzip"
|
||||
"github.com/gin-contrib/static"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -82,8 +80,7 @@ func InitMasterRouter() *gin.Engine {
|
||||
静态资源
|
||||
*/
|
||||
r.Use(gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedPaths([]string{"/api/"})))
|
||||
r.Use(middleware.InjectSiteInfo())
|
||||
r.Use(static.Serve("/", bootstrap.StaticFS))
|
||||
r.Use(middleware.FrontendFileHandler())
|
||||
r.GET("manifest.json", controllers.Manifest)
|
||||
|
||||
v3 := r.Group("/api/v3")
|
||||
|
||||
Reference in New Issue
Block a user