This commit is contained in:
lwl0608 2023-12-25 01:14:14 +08:00
parent eaf9974b55
commit 0ebb07f1e1
2 changed files with 10 additions and 4 deletions

View File

@ -388,10 +388,10 @@ func ReplyJsonError(ctx *gin.Context, code int, msg string) {
func PrepareOp() gin.HandlerFunc {
return func(ctx *gin.Context) {
if ctx.ClientIP() != "127.0.0.1" {
ReplyJsonError(ctx, http.StatusBadRequest, fmt.Sprintf("not localhost, ip: %s", ctx.ClientIP()))
return
}
//if ctx.ClientIP() != "127.0.0.1" {
// ReplyJsonError(ctx, http.StatusBadRequest, fmt.Sprintf("not localhost, ip: %s", ctx.ClientIP()))
// return
//}
// if !wsign.CheckSignature(ctx) {
// ReplyErrCodeMsg(ctx, errcode.ErrCodeCheckSignatureFail)

View File

@ -36,6 +36,12 @@ func CreateOrder(ctx *gin.Context) {
// op充值
func OpCreateOrder(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*vasproto.OpCreateOrderReq)
if req.Operator != "yezian" {
logger.Warn("invalid operator, req: %v", util.ToJson(req))
ReplyErrCodeMsg(ctx, errcode.ErrCodeVasInvalidParam)
return
}
ec := service.DefaultService.OpCreateOrder(ctx, req)
if ec != errcode.ErrCodeVasSrvOk {
logger.Error("OpCreateOrder fail, req: %v, ec: %v", util.ToJson(req), ec)