劲创营---任务项目
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.

svc_check_version.go 912 B

3 weeks ago
123456789101112131415161718192021222324252627282930313233343536
  1. package svc
  2. import (
  3. "applet/app/comm/md"
  4. "fmt"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func CheckVersion(c *gin.Context) bool {
  8. platform := c.GetHeader("platform")
  9. bools := false
  10. appVersion := c.GetHeader("app_version_name")
  11. version := ""
  12. switch platform {
  13. case md.PLATFORM_ANDROID:
  14. version = SysCfgGet(c, "android_audit_version")
  15. case md.PLATFORM_IOS:
  16. version = SysCfgGet(c, "ios_audit_version")
  17. case md.PLATFORM_WX_APPLET:
  18. version = SysCfgGet(c, "mp_audit_version")
  19. case md.PLATFORM_WAP:
  20. version = SysCfgGet(c, "mp_audit_version")
  21. case md.PLATFORM_BAIDU_APPLET:
  22. version = SysCfgGet(c, "baidu_audit_version")
  23. case md.PLATFORM_TOUTIAO_APPLET:
  24. version = SysCfgGet(c, "tt_audit_version")
  25. case md.PLATFORM_ALIPAY_APPLET:
  26. version = SysCfgGet(c, "zfb_audit_version")
  27. }
  28. fmt.Println(appVersion)
  29. fmt.Println(version)
  30. if appVersion == version && version != "" {
  31. bools = true
  32. }
  33. return bools
  34. }