明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jt_front
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
Administrator
jt_front
Commits
90642417
Commit
90642417
authored
May 29, 2026
by
zhanghan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
c34b9c8a
Pipeline
#112168
passed with stage
in 17 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
https.js
src/data/https.js
+14
-1
No files found.
src/data/https.js
View file @
90642417
...
...
@@ -52,10 +52,23 @@ export function $get ({ url, params = {}, callback, error }) {
});
};
function
removeEmptyStrings
(
obj
)
{
if
(
Array
.
isArray
(
obj
))
return
obj
.
map
(
removeEmptyStrings
);
if
(
obj
!==
null
&&
typeof
obj
===
'object'
)
{
return
Object
.
fromEntries
(
Object
.
entries
(
obj
)
.
filter
(([,
v
])
=>
v
!==
''
)
.
map
(([
k
,
v
])
=>
[
k
,
removeEmptyStrings
(
v
)])
);
}
return
obj
;
}
export
function
$post
({
url
,
data
=
{},
callback
,
error
})
{
const
router
=
useRouter
();
const
userStore
=
useUserStore
();
return
axios
.
post
(
windowConfig
.
baseUrl
+
url
,
data
).
then
((
response
)
=>
{
const
cleanData
=
removeEmptyStrings
(
data
);
return
axios
.
post
(
windowConfig
.
baseUrl
+
url
,
cleanData
).
then
((
response
)
=>
{
if
(
response
.
code
===
0
)
{
try
{
callback
&&
callback
(
response
.
data
);
...
...
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