Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
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
chenchuanwen
my-yaf-project
Commits
22588a2b
Commit
22588a2b
authored
Jan 25, 2019
by
chenchuanwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
invateTest
parent
309b5f19
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
Index.php
application/controllers/Index.php
+3
-1
Common.php
application/library/Our/Common.php
+9
-0
No files found.
application/controllers/Index.php
View file @
22588a2b
...
...
@@ -110,8 +110,10 @@ class IndexController extends \Our\Controller_Abstract {
if
(
empty
(
$req
[
'params'
]
)){
echo
'error'
;
exit
;
}
$params
=
base64_decode
(
$req
[
'params'
]);
$params
=
explode
(
'&'
,
$params
);
$params
=
\Our\Common
::
paramToJson
(
$params
);
echo
json_encode
(
$params
);
exit
;
$this
->
_view
->
assign
(
"params"
,
$params
);
}
...
...
application/library/Our/Common.php
View file @
22588a2b
...
...
@@ -334,6 +334,15 @@ public static function convertArrKey($arr, $key_name)
json_decode
(
$string
);
return
(
json_last_error
()
==
JSON_ERROR_NONE
);
}
public
static
function
paramToJson
(
$param
)
{
$array
=
array
();
$paramArrs
=
explode
(
'&'
,
$param
);
foreach
(
$paramArrs
as
$paramArr
)
{
$array
[
strstr
(
$paramArr
,
'='
,
true
)]
=
substr
(
strstr
(
$paramArr
,
'='
),
1
);
}
return
$array
;
}
/**
* sql字符串格式化
...
...
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