Browse Source

创建商品订单

kobe6258 5 months ago
parent
commit
dd5604362b
1 changed files with 8 additions and 2 deletions
  1. 8 2
      api/ht_account_api.go

+ 8 - 2
api/ht_account_api.go

@@ -66,10 +66,16 @@ func (f *HTAccountApi) EnCodeData(req CustomerRiskReq) (token string, err error)
 		err = exception.New(exception.SysError)
 		return
 	}
-	str, _ := json.Marshal(req)
+	str, err := json.Marshal(req)
+	if err != nil {
+		logger.Error("json序列化失败:%v", err)
+		err = exception.New(exception.SysError)
+		return
+	}
 	rsa, err := auth.EncryptWithRSA(publicKey, str)
 	if err != nil {
-
+		logger.Error("公钥加密失败:%v", err)
+		err = exception.New(exception.SysError)
 		return
 	}
 	token = base64.StdEncoding.EncodeToString(rsa)