代码拉取完成,页面将自动刷新
同步操作将从 后盾人/v2015 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
/** .-------------------------------------------------------------------
* | Software: [HDPHP framework, HDCMS]
* | Site: www.hdphp.com www.hdcms.com
* |-------------------------------------------------------------------
* | Author: 向军 <2300071698@qq.com>
* | Video : www.houdunren.com
* | WeChat: aihoudun
* | Copyright (c) 2012-2019, www.houdunwang.com. All Rights Reserved.
* '-------------------------------------------------------------------*/
namespace Common\Controller;
use Common\Model\ModuleModel;
use Think\Controller;
class BaseController extends Controller {
public function __construct() {
parent::__construct();
if ( method_exists( $this, '__init' ) ) {
$this->__init();
}
}
//保存数据
protected function store( Model $model, $data, \Closure $callback = null ) {
$res = $model->store( $data );
if ( $res['status'] == 'success' && $callback instanceof \Closure ) {
$callback( $res );
} else {
$this->message( $res );
}
}
//响应信息
protected function message( array $data ) {
if ( $data['status'] == 'success' ) {
$this->success( $data['message'] );
} else {
$this->error( $data['message'] );
}
exit;
}
//分配模块菜单,分配的变量以下划线开始的为系统分配
public function assignModuelMenu() {
$db = new ModuleModel();
$modules = $db->select();
foreach ( $modules as $k => $m ) {
$modules[ $k ]['actions'] = json_decode( $m['actions'], true );
}
$this->assign( '_modules', $modules );
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。