Ver Fonte

Merge branch 'debug' of http://8.136.199.33:3000/eta_mini/eta_mini_api into bzq/dev_cf

zqbao há 9 meses atrás
pai
commit
abf795cac0
4 ficheiros alterados com 14 adições e 1 exclusões
  1. 5 0
      controllers/my_chart.go
  2. 5 0
      controllers/user.go
  3. 1 1
      services/verify_code.go
  4. 3 0
      utils/config.go

+ 5 - 0
controllers/my_chart.go

@@ -6,6 +6,7 @@ import (
 	"eta/eta_mini_api/models/request"
 	"eta/eta_mini_api/models/response"
 	"eta/eta_mini_api/services"
+	"eta/eta_mini_api/services/alarm_msg"
 	"eta/eta_mini_api/utils"
 	"time"
 
@@ -253,6 +254,10 @@ func (this *MyChartController) Locate() {
 func (this *MyChartController) Detail() {
 	br := new(models.BaseResponse).Init()
 	defer func() {
+		if br.Ret != 200 {
+			b, _ := json.Marshal(br)
+			alarm_msg.SendAlarmMsg(string(b), 1)
+		}
 		this.Data["json"] = br
 		this.ServeJSON()
 	}()

+ 5 - 0
controllers/user.go

@@ -6,6 +6,7 @@ import (
 	"eta/eta_mini_api/models/request"
 	"eta/eta_mini_api/models/response"
 	"eta/eta_mini_api/services"
+	"eta/eta_mini_api/services/alarm_msg"
 	"eta/eta_mini_api/services/go_redis"
 	"eta/eta_mini_api/utils"
 	"fmt"
@@ -186,6 +187,10 @@ func (this *UserController) GenerateCaptcha() {
 func (this *UserController) GetVerifyCode() {
 	br := new(models.BaseResponse).Init()
 	defer func() {
+		if br.Ret != 200 {
+			b, _ := json.Marshal(br)
+			alarm_msg.SendAlarmMsg(string(b), 1)
+		}
 		this.Data["json"] = br
 		this.ServeJSON()
 	}()

+ 1 - 1
services/verify_code.go

@@ -6,7 +6,7 @@ import (
 	"eta/eta_mini_api/utils"
 )
 
-//go:embed lua\verify_code.lua
+//go:embed lua/verify_code.lua
 var luaVerifyCacheIncr string
 
 type VerifyCacheIncrService struct {

+ 3 - 0
utils/config.go

@@ -91,6 +91,9 @@ func init() {
 
 	SMS_TPLID = config["sms_tplId"]
 	DesKey = config["des_key"]
+	if RunMode == "debug" {
+		AlarmMsgUrl = "http://127.0.0.1:8606/api/alarm/send"
+	}
 
 	WX_MINI_APPID = config["wx_mini_appid"]
 	WX_MINI_APP_SECRET = config["wx_mini_app_secret"]