Browse Source

号码认证

herolist
huangjiajun 2 weeks ago
parent
commit
06984aa541
2 changed files with 10 additions and 1 deletions
  1. +4
    -0
      app/hdl/hdl_login.go
  2. +6
    -1
      app/svc/svc_aliyun_base.go

+ 4
- 0
app/hdl/hdl_login.go View File

@@ -116,6 +116,10 @@ func FastLogin(c *gin.Context) {
e.OutErr(c, err1.Code, err1.Error())
return
}
if req.Token == "" {
e.OutErr(c, 400, e.NewErr(400, "获取手机号失败"))
return
}
utils.FilePutContents("FastLogin", utils.SerializeStr(req))
data := svc.AliyunSmsBase(c, "")
//获取手机


+ 6
- 1
app/svc/svc_aliyun_base.go View File

@@ -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

}

Loading…
Cancel
Save