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 a70c9a7c
authored
Sep 09, 2025
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat 修改白名单post的参数处理
1 parent
8c9464d0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
dist/glsx-common.js
src/http.js
dist/glsx-common.js
View file @
a70c9a7
This diff is collapsed.
Click to expand it.
src/http.js
View file @
a70c9a7
...
@@ -31,10 +31,10 @@ Http.prototype.create = function () {
...
@@ -31,10 +31,10 @@ Http.prototype.create = function () {
async
config
=>
{
async
config
=>
{
let
{
data
=
{},
sign
=
true
,
noSignAttr
=
[],
noSessionId
=
false
}
=
config
let
{
data
=
{},
sign
=
true
,
noSignAttr
=
[],
noSessionId
=
false
}
=
config
// 获取白名单并检查接口
// 获取白名单并检查接口
const
whiteUrl
=
await
WhiteUrlManager
.
getWhiteUrls
()
;
const
whiteUrl
=
await
WhiteUrlManager
.
getWhiteUrls
()
if
(
whiteUrl
.
includes
(
data
?.
method
))
{
if
(
whiteUrl
.
includes
(
data
?.
method
))
{
data
.
sdctag
=
true
;
data
.
sdctag
=
true
}
}
if
(
!
noSessionId
)
{
if
(
!
noSessionId
)
{
data
.
sessionId
=
this
.
customer
.
sessionId
||
data
.
sessionId
data
.
sessionId
=
this
.
customer
.
sessionId
||
data
.
sessionId
...
@@ -47,6 +47,11 @@ Http.prototype.create = function () {
...
@@ -47,6 +47,11 @@ Http.prototype.create = function () {
if
(
method
==
'get'
)
{
if
(
method
==
'get'
)
{
config
.
params
=
data
config
.
params
=
data
}
else
if
(
method
==
'post'
)
{
}
else
if
(
method
==
'post'
)
{
// 将 sdctag 从 data 移到 params
if
(
data
.
sdctag
)
{
config
.
params
=
{
...
config
.
params
,
sdctag
:
data
.
sdctag
}
delete
data
.
sdctag
// 从 body 中删除 sdctag
}
if
(
config
.
headers
[
'Content-Type'
]
==
'multipart/form-data'
)
{
if
(
config
.
headers
[
'Content-Type'
]
==
'multipart/form-data'
)
{
config
.
data
=
util
.
appendFormData
(
data
)
config
.
data
=
util
.
appendFormData
(
data
)
}
else
if
(
config
.
headers
[
'Content-Type'
]
==
'application/json'
)
{
}
else
if
(
config
.
headers
[
'Content-Type'
]
==
'application/json'
)
{
...
@@ -104,7 +109,7 @@ Http.prototype.create = function () {
...
@@ -104,7 +109,7 @@ Http.prototype.create = function () {
return
this
.
service
return
this
.
service
}
}
function
logout
(
logout_function
)
{
function
logout
(
logout_function
)
{
WhiteUrlManager
.
clearCache
()
;
WhiteUrlManager
.
clearCache
()
if
(
window
[
logout_function
])
{
if
(
window
[
logout_function
])
{
window
[
logout_function
](
window
.
location
.
href
)
window
[
logout_function
](
window
.
location
.
href
)
return
return
...
...
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