Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-akm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangmingming
lcc-akm
Commits
df7dda7e
Commit
df7dda7e
authored
Mar 09, 2023
by
王明明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
超时处理
parent
444dbcac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
init.go
src/model/init.go
+4
-3
request.go
src/util/request.go
+2
-2
No files found.
src/model/init.go
View file @
df7dda7e
...
...
@@ -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
...
...
src/util/request.go
View file @
df7dda7e
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment