Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
system
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
_site-res
system
Commits
499661ec
Commit
499661ec
authored
May 25, 2018
by
tufengqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
输出帮助类修改
parent
89dc771c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
ResponseApi.php
classes/fpf/response/ResponseApi.php
+10
-13
No files found.
classes/fpf/response/ResponseApi.php
View file @
499661ec
...
...
@@ -35,7 +35,7 @@ class ResponseApi
'msg'
=>
$msg
,
];
$json
=
json_encode
(
$view
);
self
::
dumpJsonData
(
$json
,
$flag
);
return
self
::
dumpJsonData
(
$json
,
$flag
);
}
/**
...
...
@@ -52,7 +52,7 @@ class ResponseApi
BaseConstant
::
VAL
=>
$msg
];
$json
=
json_encode
(
$view
);
self
::
dumpJsonData
(
$json
,
$flag
);
return
self
::
dumpJsonData
(
$json
,
$flag
);
}
/**
...
...
@@ -74,7 +74,7 @@ class ResponseApi
* @param $json
* @param string $flag
*/
public
static
function
dumpJsonData
(
$json
,
$flag
=
''
)
public
static
function
dumpJsonData
(
$json
)
{
$callback
=
''
;
if
(
true
===
self
::
$is_support_jsonp
)
{
...
...
@@ -89,10 +89,7 @@ class ResponseApi
if
(
!
$callback
)
{
self
::
header
(
'Content-type'
,
'application/json'
);
}
echo
$json
;
if
(
BaseConstant
::
FINALTAG
===
$flag
)
{
exit
;
}
return
$json
;
}
/**
...
...
@@ -108,10 +105,10 @@ class ResponseApi
if
(
$callback
)
{
$callback
=
Html
::
encode
(
$callback_key
);
self
::
header
(
'Content-type'
,
'application/javascript'
);
echo
$callback
.
'('
.
$json_str
.
')'
;
return
$callback
.
'('
.
$json_str
.
')'
;
}
else
{
self
::
header
(
'Content-type'
,
'application/json'
);
echo
$json_str
;
return
$json_str
;
}
}
/**
...
...
@@ -127,10 +124,10 @@ class ResponseApi
if
(
$callback
)
{
$callback
=
Html
::
encode
(
$callback_key
);
self
::
header
(
'Content-type'
,
'application/javascript'
);
echo
$callback
.
'('
.
json_encode
(
$arr
)
.
')'
;
return
$callback
.
'('
.
json_encode
(
$arr
)
.
')'
;
}
else
{
self
::
header
(
'Content-type'
,
'application/json'
);
echo
json_encode
(
$arr
);
return
json_encode
(
$arr
);
}
}
...
...
@@ -149,10 +146,10 @@ class ResponseApi
if
(
$callback
)
{
$callback
=
Html
::
encode
(
$callback_key
);
self
::
header
(
'Content-type'
,
'application/javascript'
);
echo
$callback
.
'('
.
json_encode
(
$arr
)
.
')'
;
return
$callback
.
'('
.
json_encode
(
$arr
)
.
')'
;
}
else
{
self
::
header
(
'Content-type'
,
'application/json'
);
echo
json_encode
(
$arr
);
return
json_encode
(
$arr
);
}
}
...
...
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