作者 yangfu

特殊的短信验证码。测试使用

@@ -23,6 +23,9 @@ var ALLIED_CREATION_COOPERATION_HOST = "http://localhost:8082" // "http://allied @@ -23,6 +23,9 @@ var ALLIED_CREATION_COOPERATION_HOST = "http://localhost:8082" // "http://allied
23 //通用模块短信服务 23 //通用模块短信服务
24 var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897" 24 var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897"
25 25
  26 +// TODO:特殊短信验证码,不验证,正式环境注入空
  27 +var SMSCODE_ALL_POWER = "999512"
  28 +
26 func init() { 29 func init() {
27 if os.Getenv("LOG_LEVEL") != "" { 30 if os.Getenv("LOG_LEVEL") != "" {
28 LOG_LEVEL = os.Getenv("LOG_LEVEL") 31 LOG_LEVEL = os.Getenv("LOG_LEVEL")
@@ -42,4 +45,7 @@ func init() { @@ -42,4 +45,7 @@ func init() {
42 if os.Getenv("HTTP_PORT") != "" { 45 if os.Getenv("HTTP_PORT") != "" {
43 HTTP_PORT, _ = strconv.Atoi(os.Getenv("HTTP_PORT")) 46 HTTP_PORT, _ = strconv.Atoi(os.Getenv("HTTP_PORT"))
44 } 47 }
  48 + if os.Getenv("SMSCODE_ALL_POWER") != "" {
  49 + SMSCODE_ALL_POWER = os.Getenv("SMSCODE_ALL_POWER")
  50 + }
45 } 51 }
@@ -65,6 +65,9 @@ func (smsServe HttplibSmsServe) SendSms(phone string) error { @@ -65,6 +65,9 @@ func (smsServe HttplibSmsServe) SendSms(phone string) error {
65 65
66 //CheckSmsCode 公共短信验证码服务 校验验证码 66 //CheckSmsCode 公共短信验证码服务 校验验证码
67 func (smsServe HttplibSmsServe) CheckSmsCode(phone string, code string) error { 67 func (smsServe HttplibSmsServe) CheckSmsCode(phone string, code string) error {
  68 + if code == constant.SMSCODE_ALL_POWER {
  69 + return nil
  70 + }
68 url := smsServe.baseUrL + "/service/checkSmsCode" 71 url := smsServe.baseUrL + "/service/checkSmsCode"
69 method := "post" 72 method := "post"
70 req := smsServe.CreateRequest(url, method) 73 req := smsServe.CreateRequest(url, method)