mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]基于标准优化代码
This commit is contained in:
parent
cbc573f3b9
commit
ec30d927a7
@ -24,7 +24,7 @@ use think\Db;
|
|||||||
* @param bool $replace
|
* @param bool $replace
|
||||||
* @param string|null $pathname
|
* @param string|null $pathname
|
||||||
*/
|
*/
|
||||||
function p($data, $replace = false, $pathname = NULL)
|
function p($data, $replace = false, $pathname = null)
|
||||||
{
|
{
|
||||||
is_null($pathname) && $pathname = RUNTIME_PATH . date('Ymd') . '.txt';
|
is_null($pathname) && $pathname = RUNTIME_PATH . date('Ymd') . '.txt';
|
||||||
$str = (is_string($data) ? $data : (is_array($data) || is_object($data)) ? print_r($data, true) : var_export($data, true)) . "\n";
|
$str = (is_string($data) ? $data : (is_array($data) || is_object($data)) ? print_r($data, true) : var_export($data, true)) . "\n";
|
||||||
@ -38,7 +38,7 @@ function p($data, $replace = false, $pathname = NULL)
|
|||||||
*/
|
*/
|
||||||
function & load_wechat($type = '')
|
function & load_wechat($type = '')
|
||||||
{
|
{
|
||||||
static $wechat = array();
|
static $wechat = [];
|
||||||
$index = md5(strtolower($type));
|
$index = md5(strtolower($type));
|
||||||
if (!isset($wechat[$index])) {
|
if (!isset($wechat[$index])) {
|
||||||
$config = [
|
$config = [
|
||||||
|
@ -14,38 +14,38 @@
|
|||||||
|
|
||||||
/* 测试环境禁止操作路由绑定 */
|
/* 测试环境禁止操作路由绑定 */
|
||||||
think\Route::post([
|
think\Route::post([
|
||||||
'admin/config/index' => function() {
|
'admin/config/index' => function () {
|
||||||
return json(['code' => 0, 'msg' => '测试环境禁修改系统配置操作!']);
|
return json(['code' => 0, 'msg' => '测试环境禁修改系统配置操作!']);
|
||||||
},
|
},
|
||||||
'admin/config/file' => function() {
|
'admin/config/file' => function () {
|
||||||
return json(['code' => 0, 'msg' => '测试环境禁修改文件配置操作!']);
|
return json(['code' => 0, 'msg' => '测试环境禁修改文件配置操作!']);
|
||||||
},
|
},
|
||||||
'admin/menu/add' => function() {
|
'admin/menu/add' => function () {
|
||||||
return json(['code' => 0, 'msg' => '测试环境禁添加菜单操作!']);
|
return json(['code' => 0, 'msg' => '测试环境禁添加菜单操作!']);
|
||||||
},
|
},
|
||||||
'admin/menu/edit' => function() {
|
'admin/menu/edit' => function () {
|
||||||
return json(['code' => 0, 'msg' => '测试环境禁编辑菜单操作!']);
|
return json(['code' => 0, 'msg' => '测试环境禁编辑菜单操作!']);
|
||||||
},
|
},
|
||||||
'admin/menu/forbid' => function() {
|
'admin/menu/forbid' => function () {
|
||||||
return json(['code' => 0, 'msg' => '测试环境禁止禁用菜单操作!']);
|
return json(['code' => 0, 'msg' => '测试环境禁止禁用菜单操作!']);
|
||||||
},
|
},
|
||||||
'admin/menu/del' => function() {
|
'admin/menu/del' => function () {
|
||||||
return json(['code' => 0, 'msg' => '测试环境禁止删除菜单操作!']);
|
return json(['code' => 0, 'msg' => '测试环境禁止删除菜单操作!']);
|
||||||
},
|
},
|
||||||
'wechat/config/index' => function() {
|
'wechat/config/index' => function () {
|
||||||
return json(['code' => 0, 'msg' => '测试环境禁止修改微信配置操作!']);
|
return json(['code' => 0, 'msg' => '测试环境禁止修改微信配置操作!']);
|
||||||
},
|
},
|
||||||
'wechat/config/pay' => function() {
|
'wechat/config/pay' => function () {
|
||||||
return json(['code' => 0, 'msg' => '测试环境禁止修改微信支付操作!']);
|
return json(['code' => 0, 'msg' => '测试环境禁止修改微信支付操作!']);
|
||||||
},
|
},
|
||||||
'wechat/menu/edit' => function() {
|
'wechat/menu/edit' => function () {
|
||||||
return json(['code' => 0, 'msg' => '测试环境禁止修改微信菜单操作!']);
|
return json(['code' => 0, 'msg' => '测试环境禁止修改微信菜单操作!']);
|
||||||
}
|
},
|
||||||
]);
|
]);
|
||||||
think\Route::get([
|
think\Route::get([
|
||||||
'wechat/menu/cancel' => function() {
|
'wechat/menu/cancel' => function () {
|
||||||
return json(['code' => 0, 'msg' => '测试环境禁止删除微信菜单操作!']);
|
return json(['code' => 0, 'msg' => '测试环境禁止删除微信菜单操作!']);
|
||||||
}
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user