|
|
@@ -1,10 +1,12 @@ |
|
|
|
package svc |
|
|
|
|
|
|
|
import ( |
|
|
|
"applet/app/cfg" |
|
|
|
"applet/app/db" |
|
|
|
"applet/app/svc/sys_cfg" |
|
|
|
"github.com/gin-gonic/gin" |
|
|
|
"github.com/tidwall/gjson" |
|
|
|
"os" |
|
|
|
) |
|
|
|
|
|
|
|
func AliyunCaptchBase(c *gin.Context) (string, string) { |
|
|
@@ -24,7 +26,10 @@ func AliyunCaptchBase(c *gin.Context) (string, string) { |
|
|
|
func AliyunSmsBase(c *gin.Context, types string) map[string]string { |
|
|
|
sysCfgDb := sys_cfg.NewSysCfgDb(db.Db) |
|
|
|
data := sysCfgDb.SysCfgFindWithDb("aliyun_sms_id", "aliyun_sms_secret", "aliyun_sms_code", "aliyun_sms_sign_name") |
|
|
|
if cfg.Prd { |
|
|
|
data["aliyun_sms_id"] = os.Getenv("aliyun_sms_id") |
|
|
|
data["aliyun_sms_secret"] = os.Getenv("aliyun_sms_secret") |
|
|
|
} |
|
|
|
data["aliyun_sms_code"] = gjson.Get(data["aliyun_sms_code"], types).String() |
|
|
|
return data |
|
|
|
|
|
|
|
} |