蛋蛋星球-客户端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

34 行
1.2 KiB

  1. package svc
  2. import (
  3. "applet/app/db"
  4. "applet/app/utils/cache"
  5. "code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
  6. "github.com/gin-gonic/gin"
  7. "github.com/tidwall/gjson"
  8. )
  9. func AliyunCaptchBase(c *gin.Context) (string, string) {
  10. redisConn := cache.GetPool().Get()
  11. sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
  12. data := sysCfgDb.SysCfgFindWithDb("aliyun_captch_id_android", "aliyun_captch_key_android", "aliyun_captch_id_ios", "aliyun_captch_key_ios", "aliyun_captch_id_h5", "aliyun_captch_key_h5")
  13. if c.GetHeader("platform") == "android" {
  14. return data["aliyun_captch_id_android"], data["aliyun_captch_key_android"]
  15. }
  16. if c.GetHeader("platform") == "iOS" {
  17. return data["aliyun_captch_id_ios"], data["aliyun_captch_key_ios"]
  18. }
  19. if c.GetHeader("platform") == "wap" {
  20. return data["aliyun_captch_id_h5"], data["aliyun_captch_key_h5"]
  21. }
  22. return "", ""
  23. }
  24. func AliyunSmsBase(c *gin.Context, types string) map[string]string {
  25. redisConn := cache.GetPool().Get()
  26. sysCfgDb := implement.NewSysCfgDb(db.Db, redisConn)
  27. data := sysCfgDb.SysCfgFindWithDb("aliyun_sms_id", "aliyun_sms_secret", "aliyun_sms_code", "aliyun_sms_sign_name")
  28. data["aliyun_sms_code"] = gjson.Get(data["aliyun_sms_code"], types).String()
  29. return data
  30. }