feat:完善项目

This commit is contained in:
henry
2022-01-17 11:34:39 +08:00
parent b50fdb0d44
commit 8fd5283b0e
6 changed files with 187 additions and 10 deletions

View File

@ -319,6 +319,9 @@ func registerAdminAPI(app *gin.Engine) {
technology.POST("/paper", _api.Paper)
technology.POST("/paper/detail", _api.PaperDetail)
technology.POST("/paper/delete", _api.PaperDelete)
technology.POST("/product", _api.Product)
technology.POST("/product/detail", _api.ProductDetail)
technology.POST("/product/delete", _api.ProductDelete)
}
// Activity 活动管理
activity := v1.Group("/activity")

View File

@ -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))