<?php
namespace app\file\controller;

use think\Controller;
use think\Db;
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020 http://mifenlei.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: @梦雨 <50361804@qq.com>
// +----------------------------------------------------------------------
class Index extends Controller
{
    public function _initialize()
    {
        if (user('admin')==0) {
             $this->error('无权限', url('index/index/index'));
        }
    }
    //模板文件列表
    public function index()
    {
        if (strpos(input('id'), 'template') === false) {
            $this->error('你迷路了', url('index/index/index'));
        }
        return $this->fetch('/index');
    }
    // 编辑
    public function updata()
    {
        if (strpos(input('id'), 'template') === false) {
            $this->error('你迷路了', url('index/index/index'));
        }
        if (request()->isPost()) {
	    	$this->error(config('web.sq')); 
    	} 
    	$this->assign('id',input('id'));
        return $this->fetch('/updata');
    }
    //创建文件
    public function establish()
    {
        $this->error(config('web.sq')); 
    }
    //删除文件
    public function delete()
    {
        $this->error(config('web.sq')); 
    }
}