feat:完善项目
This commit is contained in:
@ -37,10 +37,13 @@ func (this *Router) Init() *gin.Engine {
|
||||
if this.IsCors {
|
||||
app.Use(Cors())
|
||||
}
|
||||
app.LoadHTMLFiles("./dist/*") // 添加资源路径
|
||||
//app.LoadHTMLFiles("./dist/*") // 添加资源路径
|
||||
app.LoadHTMLGlob("./dist/index.html") // 添加资源路径
|
||||
app.StaticFS("/static", http.Dir("./dist/static"))
|
||||
app.StaticFile("/", "dist/index.html") //前端接口
|
||||
|
||||
app.GET("", func(c *gin.Context) {
|
||||
c.HTML(http.StatusOK, "index.html", nil)
|
||||
})
|
||||
//app.NoRoute(NoRouteHandler())
|
||||
app.NoMethod(NoMethodHandler())
|
||||
app.Use(LoggerHandle("log/gin.log", 3))
|
||||
|
Reference in New Issue
Block a user