no message

master
DESKTOP-4RNDQIC\29019 2021-03-08 23:59:50 +08:00
parent e2ca2baa65
commit e8cfa46cf8
2 changed files with 6 additions and 3 deletions

View File

@ -37,7 +37,7 @@ func CORSMiddleware(c *gin.Context) {
c.Writer.Header().Set("Access-Control-Allow-Origin", "https://testingcloud.club")
} else {
c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
c.Writer.Header().Set("Access-Control-Allow-Origin", "http://localhost:8080")
}
c.Writer.Header().Set("Access-Control-Max-Age", "86400")
c.Writer.Header().Set("Access-Control-Allow-Headers",
@ -98,7 +98,6 @@ func main() {
InitLogs()
InitRedisConfig()
InitMysql()
// InitElasticSearch()
r := gin.Default()
store := sessions.NewCookieStore([]byte("secret123"))
@ -182,7 +181,8 @@ func main() {
api.DELETE("/plan", planController.DelPlan) // 删除计划
api.POST("/plan_days", planController.PlanDay) // 获取本月有计划天数
api.GET("/plan_types", planController.Types)
api.GET("planDays")
api.PUT("/undo",planController.CreateUndo)
}
openapi := r.Group("openapi")

View File

@ -32,6 +32,9 @@ type PlanType struct {
TypeName string `gorm:"column:type_name;" json:"type_name"`
}
func (m *Undo) TableName() string {
return "undo"
}
func (m *PlanType) TableName() string {
return "plan_type"
}