Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-common
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit aef25083
authored
Sep 26, 2023
by
杨明
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更改post请求格式
1 parent
46500def
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
dist/glsx-common.js
package-lock.json
src/http.js
dist/glsx-common.js
View file @
aef2508
This diff is collapsed.
Click to expand it.
package-lock.json
View file @
aef2508
{
"name"
:
"glsx-common"
,
"version"
:
"
1.3.2
"
,
"version"
:
"
2.1.0
"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"dependencies"
:
{
...
...
src/http.js
View file @
aef2508
...
...
@@ -28,7 +28,8 @@ function Http(options = {}) {
Http
.
prototype
.
create
=
function
()
{
this
.
service
.
interceptors
.
request
.
use
(
config
=>
{
let
{
data
=
{},
sign
=
true
,
noSignAttr
=
[]
}
=
config
let
{
data
=
{},
sign
=
true
,
noSignAttr
=
[],
noNeed
=
false
}
=
config
if
(
!
noNeed
)
data
.
sessionId
=
this
.
customer
.
sessionId
||
data
.
sessionId
if
(
sign
)
{
let
_configSign
=
this
.
customer
.
sign
||
{}
...
...
@@ -40,6 +41,8 @@ Http.prototype.create = function () {
}
else
if
(
method
==
'post'
)
{
if
(
config
.
headers
[
'Content-Type'
]
==
'multipart/form-data'
)
{
config
.
data
=
util
.
appendFormData
(
data
)
}
else
if
(
config
.
headers
[
'Content-Type'
]
==
'application/json'
)
{
config
.
data
=
data
}
else
{
config
.
data
=
qs
.
stringify
(
data
)
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment