蛋蛋星球-客户端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

svc_aliyun_base.go 1.1 KiB

1 mese fa
1 settimana fa
1 mese fa
1 settimana fa
1 mese fa
1 settimana fa
1 mese fa
123456789101112131415161718192021222324252627282930
  1. package svc
  2. import (
  3. "applet/app/db"
  4. "applet/app/svc/sys_cfg"
  5. "github.com/gin-gonic/gin"
  6. "github.com/tidwall/gjson"
  7. )
  8. func AliyunCaptchBase(c *gin.Context) (string, string) {
  9. sysCfgDb := sys_cfg.NewSysCfgDb(db.Db)
  10. 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")
  11. if c.GetHeader("platform") == "android" {
  12. return data["aliyun_captch_id_android"], data["aliyun_captch_key_android"]
  13. }
  14. if c.GetHeader("platform") == "iOS" {
  15. return data["aliyun_captch_id_ios"], data["aliyun_captch_key_ios"]
  16. }
  17. if c.GetHeader("platform") == "wap" {
  18. return data["aliyun_captch_id_h5"], data["aliyun_captch_key_h5"]
  19. }
  20. return "", ""
  21. }
  22. func AliyunSmsBase(c *gin.Context, types string) map[string]string {
  23. sysCfgDb := sys_cfg.NewSysCfgDb(db.Db)
  24. data := sysCfgDb.SysCfgFindWithDb("aliyun_sms_id", "aliyun_sms_secret", "aliyun_sms_code", "aliyun_sms_sign_name")
  25. data["aliyun_sms_code"] = gjson.Get(data["aliyun_sms_code"], types).String()
  26. return data
  27. }