You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package middleware
import (
"github.com/gin-gonic/gin"
)
func AppVersion(c *gin.Context) {
//if c.Request.Method == "POST" {
// system := c.Request.Header.Get("X-Recook-System")
// version, _ := strconv.Atoi(c.Request.Header.Get("X-Recook-version"))
// if system == "android" && version > 270 {
// //http.Fail(c, "服务器已维护成功,请前往应用市场更新")
// //c.Abort()
// //return
// } else if system == "ios" && version > 270 {
// //http.Fail(c, "服务器已维护成功,请前往应用市场更新")
// //c.Abort()
// //return
// } else if system == "recookapi" {
// //http.Fail(c, "服务器已维护成功,请前往应用市场更新")
// //c.Abort()
// //return
// } else if system == "wxapp" && version > 30 {
// //http.Fail(c, "服务器已维护成功,请前往应用市场更新")
// //c.Abort()
// //return
// } else {
// http.Fail(c, "服务器升级维护中预计将于3月31号完成")
// c.Abort()
// return
// }
//}
//system := c.Request.Header.Get("X-Recook-System")
//version, _ := strconv.Atoi(c.Request.Header.Get("X-Recook-version"))
//if system == "android" && version < 270 {
// http.Fail(c, "当前版本过低,请前往应用市场更新")
// c.Abort()
// return
//}
//if system == "ios" && version < 270 {
// http.Fail(c, "当前版本过低,请前往应用市场更新")
// c.Abort()
// return
//}
}