Commit df7dda7e authored by 王明明's avatar 王明明

超时处理

parent 444dbcac
......@@ -4,6 +4,7 @@ import (
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"
"net/http"
"strings"
"test/util"
"time"
)
......@@ -19,9 +20,9 @@ func routeToU2(w http.ResponseWriter, r *http.Request) {
carrierType := data["type"]
var akm *Akm
switch carrierType {
switch strings.ToUpper(carrierType) {
case "U2":
akm = EasyJet(carrierType.(string), data["proxy"].(string))
akm = EasyJet(carrierType, data["proxy"])
default:
util.WriteJson(w, util.ErrorJson("不支持的航司"))
return
......@@ -45,7 +46,7 @@ func routeToU2(w http.ResponseWriter, r *http.Request) {
}
func checkPostRequire(data map[string]interface{}) bool {
func checkPostRequire(data map[string]string) bool {
_, ok := data["type"]
if !ok {
return false
......
......@@ -5,8 +5,8 @@ import (
"net/http"
)
func GetPostJson(r *http.Request) map[string]interface{} {
formData := make(map[string]interface{})
func GetPostJson(r *http.Request) map[string]string {
formData := make(map[string]string)
// 调用json包的解析,解析请求body
json.NewDecoder(r.Body).Decode(&formData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment