蛋蛋星球-客户端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
1.1 KiB

  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. }