蛋蛋星球-客户端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

svc_aliyun_base.go 1.2 KiB

pirms 1 dienas
123456789101112131415161718192021222324252627282930313233
  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. }