• tp6重构80cms系统配置


    //系统配置
        function config(){
    		if (!$this->request->isPost()){
    			$info = db("config")->find(1);
    		    // dump($info);
    			$this->view->assign('info',checkData($info,false));
    			// $this->view->assign('themesList',CatagoryService::tplList(''));
    			return view('base/config');
    		}else{
    			$data = $this->request->post();
    			// dump($data);exit;
                   $where['c_name']=$data['c_name'];
                   $where['c_webname'] = $data['c_webname'];
    			   $where['c_weburl'] = $data['c_weburl'];
    			   $where['c_indextemp'] =$data['c_indextemp'];
    			   $where['c_webtemp']= $data['c_webtemp'];
    			   $where['c_mobiletemp']= $data['c_mobiletemp'];
    			   $where['c_indexkeyword']= $data['c_indexkeyword'];
    			   $where['c_indexdescription']= $data['c_indexkeyword'];
    			   $where['c_webcopyright']= $data['c_webcopyright'];
    			   $where['c_icpnum']= $data['c_icpnum'];
    			   $result=db('config')->where(['c_id'=>1])->save($where);
    			   if($result){
    			   	 // return json(['status'=>'00','msg'=>'修改成功']);
    			   	$this->success('修改成功',url('Base/config'));
    			   	}else{
    			   	$this->error('无修改,正在返回',url('Base/config'));
    			   	}           
    		}
    	}
    

      继承admin.php

    <?php
    /**
     * ============================================================================
     * * COPYRIGHT 2016-2019 xhadmin.com , and all rights reserved.
     * * WEBSITE: http://www.xhadmin.com;
     * ----------------------------------------------------------------------------
     * This is not a free software!You have not used for commercial purposes in the
     * premise of the program code to modify and use; and publication does not allow
     * any form of code for any purpose.
     * ============================================================================
     * Author:  QQ:2228293408
     */
     
    namespace appadmincontroller;
    use thinkexceptionFuncNotFoundException;
    use thinkexceptionValidateException;
    use appBaseController;
    
    class Admin extends BaseController
    {
    	
    	public function initialize(){
    		$controller = $this->request->controller();
    		$action = $this->request->action();
    		$app = app('http')->getName();
    		
    		$admin = session('admin');
            $userid = session('admin_sign') == data_auth_sign($admin) ? $admin['a_id'] : 0;
    		
            if( !$userid && ( $app <> 'admin' || $controller <> 'Login' )){
    			echo '<script type="text/javascript">window.parent.frames.location.href="'.url('admin/Login/index').'";</script>';exit();
            }
    
    		$url =  "{$app}/{$controller}/{$action}";
    		// if(session('admin.role_id') <> 1 && !in_array($url,config('my.nocheck')) && $action !== 'getExtends' && $controller <> 'FormData'){	
    		// 	if(!in_array($url,session('admin.nodes'))){
    		// 		throw new ValidateException ('你没操作权限');
    		// 	}
    		// }
    		
    		event('DoLog');
    		
    		$list = db("config")->cache(true,60)->find(1);
    		config($list,'xhadmin');
    	}
    	
    	public function __call($method, $args){
            throw new FuncNotFoundException('方法不存在',$method);
        }
    
    }
    

      

  • 相关阅读:
    spart快速大数据分析学习提纲(一)
    Zookeeper的设计模式之观察者模式(十)
    shuffle机制和TextInputFormat分片和读取分片数据(九)
    MapReduce程序开发之流量求和(八)
    分布式系统间通信之RPC简单Demo(七)
    使用JAVA客户端对HDFS进行代码编写(五)
    分布式系统间通信之RPC的基本概念(六)
    DataNode工作原理(四)
    NameNode元数据的管理机制(三)
    javaweb项目部署到服务器(树莓派)上全过程——部署步骤记录与总结
  • 原文地址:https://www.cnblogs.com/mo3408/p/13688159.html
Copyright © 2020-2023  润新知