Browse Source

后台文章

master
林一峰 7 years ago
parent
commit
27a6f158c2
  1. 1
      .env.example
  2. 160
      app/Common/function.php
  3. 281
      app/Http/Controllers/Admin/ArticleController.php
  4. 123
      app/Http/Controllers/Admin/CategoryController.php
  5. 54
      app/Http/Controllers/Admin/CommonController.php
  6. 35
      app/Http/Controllers/Admin/IndexController.php
  7. 95
      app/Http/Controllers/Admin/LoginController.php
  8. 85
      app/Http/Controllers/Admin/PageController.php
  9. 44
      app/Http/Controllers/Controller.php
  10. 12
      app/Http/Controllers/Home/CommonController.php
  11. 33
      app/Http/Controllers/Home/IndexController.php
  12. 4
      app/Http/Controllers/Wap/IndexController.php
  13. 2
      app/Http/Kernel.php
  14. 28
      app/Http/Middleware/CheckLogin.php
  15. 41
      app/Http/Model/Arctype.php
  16. 61
      app/Http/Model/Article.php
  17. 17
      app/Http/Model/Sysconfig.php
  18. 25
      app/Http/Model/User.php
  19. 25
      app/Http/Model/UserRole.php
  20. 5
      composer.json
  21. 64
      composer.lock
  22. 4
      config/app.php
  23. 12
      config/custom.php
  24. 2
      config/database.php
  25. 2
      public/index.php
  26. 164
      resources/views/admin/article/add.blade.php
  27. 147
      resources/views/admin/article/edit.blade.php
  28. 115
      resources/views/admin/article/index.blade.php
  29. 26
      resources/views/admin/article/repetarc.blade.php
  30. 145
      resources/views/admin/category/add.blade.php
  31. 21
      resources/views/admin/category/index.blade.php
  32. 12
      resources/views/admin/common/header.blade.php
  33. 26
      resources/views/admin/common/leftmenu.blade.php
  34. 18
      resources/views/admin/index/index.blade.php
  35. 47
      resources/views/admin/index/jump.blade.php
  36. 172
      resources/views/admin/login/login.blade.php
  37. 160
      resources/views/admin/page/add.blade.php
  38. 156
      resources/views/admin/page/edit.blade.php
  39. 33
      resources/views/admin/page/index.blade.php
  40. 20
      resources/views/home/404.blade.php
  41. 63
      routes/web.php

1
.env.example

@ -13,6 +13,7 @@ DB_PORT=3306
DB_DATABASE=lqycms DB_DATABASE=lqycms
DB_USERNAME=root DB_USERNAME=root
DB_PASSWORD=123456 DB_PASSWORD=123456
DB_PREFIX=fl_
BROADCAST_DRIVER=log BROADCAST_DRIVER=log
CACHE_DRIVER=file CACHE_DRIVER=file

160
app/Common/function.php

@ -1,13 +1,17 @@
<?php <?php
// 公共函数文件 // 公共函数文件
//定义常量
define('FLADMIN', '/fladmin'); // 后台模块,首字母最好大写
define('CMS_VERSION', '1.1.0'); // 版本号
function dataList($modelname, $map = '', $orderby = '', $field = '*', $listRows = 15)
//获取数据
function dataList($modelname, $where = '', $orderby = '', $field = '*', $size = 15, $page = 1)
{ {
return db($modelname)->where($map)->field($field)->order($orderby)->limit($limit)->select();
$model = \DB::table($modelname);
if($where!=''){$model = $model->where($where);}
if($orderby!=''){$model = $model->orderBy($orderby[0], $orderby[1]);}
if($field!='*'){$model = $model->select(\DB::raw($field));}
$skip = ($page-1)*$size;
return object_to_array($model->skip($skip)->take($size)->get());
} }
//pc前台栏目、标签、内容页面地址生成 //pc前台栏目、标签、内容页面地址生成
@ -18,17 +22,17 @@ function get_front_url($param='')
if($param['type'] == 'list') if($param['type'] == 'list')
{ {
//列表页 //列表页
$url .= '/cat'.$param['catid'].'.html';
$url .= '/cat'.$param['catid'];
} }
else if($param['type'] == 'content') else if($param['type'] == 'content')
{ {
//内容页 //内容页
$url .= '/cat'.$param['catid'].'/id'.$param['id'].'.html';
$url .= '/p/'.$param['id'];
} }
else if($param['type'] == 'tags') else if($param['type'] == 'tags')
{ {
//tags页面 //tags页面
$url .= '/tag'.$param['tagid'].'.html';
$url .= '/tag'.$param['tagid'];
} }
else if($param['type'] == 'page') else if($param['type'] == 'page')
{ {
@ -40,24 +44,24 @@ function get_front_url($param='')
} }
//wap前台栏目、标签、内容页面地址生成 //wap前台栏目、标签、内容页面地址生成
function murl(array $param)
function get_wap_front_url(array $param)
{ {
$url = ''; $url = '';
if($param['type'] == 'list') if($param['type'] == 'list')
{ {
//列表页 //列表页
$url .= '/cat'.$param['catid'].'.html';
$url .= '/cat'.$param['catid'];
} }
else if($param['type'] == 'content') else if($param['type'] == 'content')
{ {
//内容页 //内容页
$url .= '/cat'.$param['catid'].'/id'.$param['id'].'.html';
$url .= '/p/'.$param['id'];
} }
else if($param['type'] == 'tags') else if($param['type'] == 'tags')
{ {
//tags页面 //tags页面
$url .= '/tag'.$param['tagid'].'.html';
$url .= '/tag'.$param['tagid'];
} }
else if($param['type'] == 'page') else if($param['type'] == 'page')
{ {
@ -460,10 +464,10 @@ function typeinfo($typeid)
} }
//根据栏目id获取该栏目下文章/商品的数量 //根据栏目id获取该栏目下文章/商品的数量
function catarcnum($typeid,$modelname='article')
function catarcnum($typeid, $modelname='article')
{ {
$map['typeid']=$typeid; $map['typeid']=$typeid;
return db($modelname)->where($map)->count('id');
return \DB::table($modelname)->where($map)->count('id');
} }
//根据Tag id获取该Tag标签下文章的数量 //根据Tag id获取该Tag标签下文章的数量
@ -491,11 +495,12 @@ function imgmatch($url)
} }
//将栏目列表生成数组 //将栏目列表生成数组
function get_category($modelname,$parent_id=0,$pad=0)
function get_category($modelname, $parent_id=0, $pad=0)
{ {
$arr=array(); $arr=array();
$cats = db($modelname)->where("reid=$parent_id")->order('id asc')->select();
$temp = \DB::table($modelname)->where('reid', $parent_id)->orderBy('id', 'asc')->get();
$cats = object_to_array($temp);
if($cats) if($cats)
{ {
@ -512,9 +517,10 @@ function get_category($modelname,$parent_id=0,$pad=0)
} }
} }
function tree($list,$pid=0)
function category_tree($list,$pid=0)
{ {
global $temp; global $temp;
if(!empty($list)) if(!empty($list))
{ {
foreach($list as $v) foreach($list as $v)
@ -523,10 +529,11 @@ function tree($list,$pid=0)
//echo $v['id']; //echo $v['id'];
if(array_key_exists("child",$v)) if(array_key_exists("child",$v))
{ {
tree($v['child'],$v['reid']);
category_tree($v['child'],$v['reid']);
} }
} }
} }
return $temp; return $temp;
} }
@ -568,6 +575,39 @@ function taglist($id,$tagid=0)
if($tags!=""){return db("tagindex")->where($tags)->select();} if($tags!=""){return db("tagindex")->where($tags)->select();}
} }
//读取动态配置
function sysconfig($varname='')
{
$sysconfig = cache('sysconfig');
$res = '';
if(empty($sysconfig))
{
cache()->forget('sysconfig');
$sysconfig = \App\Http\Model\Sysconfig::orderBy('id')->select('varname', 'value')->get()->toArray();
cache(['sysconfig' => $sysconfig], \Carbon\Carbon::now()->addMinutes(86400));
}
if($varname != '')
{
foreach($sysconfig as $row)
{
if($varname == $row['varname'])
{
$res = $row['value'];
}
}
}
else
{
$res = $sysconfig;
}
return $res;
}
//获取https的get请求结果 //获取https的get请求结果
function get_curl_data($c_url,$data='') function get_curl_data($c_url,$data='')
{ {
@ -788,3 +828,85 @@ function dir_delete($dir)
closedir($handle); closedir($handle);
return @rmdir($dir); return @rmdir($dir);
} }
//对象转数组
function object_to_array($object, $get=0)
{
$res = '';
if($get==0)
{
foreach($object as $key=>$value)
{
$res[$key] = (array)$value;
}
}
else
{
$res = (array)$object;
}
return $res;
}
/**
* 操作错误跳转的快捷方法
* @access protected
* @param string $msg 错误信息
* @param string $url 页面跳转地址
* @param mixed $time 当数字时指定跳转时间
* @return void
*/
function error_jump($msg='', $url='', $time=3)
{
if ($url=='' && isset($_SERVER["HTTP_REFERER"]))
{
$url = $_SERVER["HTTP_REFERER"];
}
if(!headers_sent())
{
header("Location:".route('admin_jump')."?error=$msg&url=$url&time=$time");
exit();
}
else
{
$str = "<meta http-equiv='Refresh' content='URL=".route('admin_jump')."?error=$msg&url=$url&time=$time"."'>";
exit($str);
}
}
/**
* 操作成功跳转的快捷方法
* @access protected
* @param string $msg 提示信息
* @param string $url 页面跳转地址
* @param mixed $time 当数字时指定跳转时间
* @return void
*/
function success_jump($msg='', $url='', $time=1)
{
if ($url=='' && isset($_SERVER["HTTP_REFERER"]))
{
$url = $_SERVER["HTTP_REFERER"];
}
if(!headers_sent())
{
header("Location:".route('admin_jump')."?message=$msg&url=$url&time=$time");
exit();
}
else
{
$str = "<meta http-equiv='Refresh' content='URL=".route('admin_jump')."?message=$msg&url=$url&time=$time"."'>";
exit($str);
}
}

281
app/Http/Controllers/Admin/ArticleController.php

@ -0,0 +1,281 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class ArticleController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$res = '';
$where = function ($query) use ($res) {
if(isset($_REQUEST["keyword"]))
{
$query->where('title', 'like', '%'.$_REQUEST['keyword'].'%');
}
if(isset($_REQUEST["typeid"]) && $_REQUEST["typeid"]!=0)
{
$query->where('typeid', $_REQUEST["typeid"]);
}
if(isset($_REQUEST["id"]))
{
$query->where('typeid', $_REQUEST["id"]);
}
if(isset($_REQUEST["ischeck"]))
{
$query->where('ischeck', $_REQUEST["ischeck"]); //未审核过的文章
}
};
$posts = parent::pageList('article', $where);
foreach($posts as $key=>$value)
{
$info = DB::table('arctype')->select('typename')->where("id", $value->typeid)->first();
$posts[$key]->typename = $info->typename;
$posts[$key]->body = '';
}
$data['posts'] = $posts;
return view('admin.article.index', $data);
//if(!empty($_GET["id"])){$id = $_GET["id"];}else {$id="";}if(preg_match('/[0-9]*/',$id)){}else{exit;}
/* if(!empty($id)){$map['typeid']=$id;}
$Article = M("Article")->field('id')->where($map);
$counts = $Article->count();
$pagesize =CMS_PAGESIZE;$page =0;
if($counts % $pagesize){ //取总数据量除以每页数的余数
$pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果
}else{$pages = $counts/$pagesize;}
if(!empty($_GET["page"])){$page = $_GET["page"]-1;$nextpage=$_GET["page"]+1;$previouspage=$_GET["page"]-1;}else{$page = 0;$nextpage=2;$previouspage=0;}
if($counts>0){if($page>$pages-1){exit;}}
$start = $page*$pagesize;
$Article = M("Article")->field('id,typeid,title,pubdate,click,litpic,tuijian')->where($map)->order('id desc')->limit($start,$pagesize)->select();
$this->counts = $counts;
$this->pages = $pages;
$this->page = $page;
$this->nextpage = $nextpage;
$this->previouspage = $previouspage;
$this->id = $id;
$this->posts = $Article; */
//echo '<pre>';
//print_r($Article);
//return $this->fetch();
}
public function add()
{
$data = '';
if(!empty($_REQUEST["catid"])){$data['catid'] = $_REQUEST["catid"];}else{$data['catid'] = 0;}
return view('admin.article.add', $data);
}
public function doadd()
{
$litpic="";if(!empty($_POST["litpic"])){$litpic = $_POST["litpic"];}else{$_POST['litpic']="";} //缩略图
if(empty($_POST["description"])){if(!empty($_POST["body"])){$_POST['description']=cut_str($_POST["body"]);}} //description
$content="";if(!empty($_POST["body"])){$content = $_POST["body"];}
$_POST['pubdate'] = time();//更新时间
$_POST['addtime'] = time();//添加时间
$_POST['user_id'] = $_SESSION['admin_user_info']['id']; // 发布者id
//关键词
if(!empty($_POST["keywords"]))
{
$_POST['keywords']=str_replace("",",",$_POST["keywords"]);
}
else
{
if(!empty($_POST["title"]))
{
$title=$_POST["title"];
$title=str_replace("","",$title);
$title=str_replace(",","",$title);
$_POST['keywords']=get_keywords($title);//标题分词
}
}
if(isset($_POST["dellink"]) && $_POST["dellink"]==1 && !empty($content)){$content=replacelinks($content,array(sysconfig('CMS_BASEHOST')));} //删除非站内链接
$_POST['body']=$content;
//提取第一个图片为缩略图
if(isset($_POST["autolitpic"]) && $_POST["autolitpic"] && empty($litpic))
{
if(getfirstpic($content))
{
//获取文章内容的第一张图片
$imagepath = '.'.getfirstpic($content);
//获取后缀名
preg_match_all ("/\/(.+)\.(gif|jpg|jpeg|bmp|png)$/iU",$imagepath,$out, PREG_PATTERN_ORDER);
$saveimage='./uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0];
//生成缩略图,按照原图的比例生成一个最大为240*180的缩略图
\Intervention\Image\Facades\Image::make($imagepath)->resize(sysconfig('CMS_IMGWIDTH'), sysconfig('CMS_IMGHEIGHT'))->save($saveimage);
//缩略图路径
$_POST['litpic']='/uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0];
}
}
unset($_POST["dellink"]);
unset($_POST["autolitpic"]);
unset($_POST["_token"]);
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if(DB::table('article')->insert($_POST))
{
success_jump("添加成功!");
}
else
{
error_jump("添加失败!请修改后重新添加");
}
}
public function edit()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else {$id="";}if(preg_match('/[0-9]*/',$id)){}else{exit;}
$data['id'] = $id;
$data['post'] = object_to_array(DB::table('article')->where('id', $id)->first(), 1);
return view('admin.article.edit', $data);
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;}
$litpic="";if(!empty($_POST["litpic"])){$litpic = $_POST["litpic"];}else{$_POST['litpic']="";} //缩略图
if(empty($_POST["description"])){if(!empty($_POST["body"])){$_POST['description']=cut_str($_POST["body"]);}} //description
$content="";if(!empty($_POST["body"])){$content = $_POST["body"];}
$_POST['pubdate'] = time();//更新时间
$_POST['user_id'] = $_SESSION['admin_user_info']['id']; // 修改者id
if(!empty($_POST["keywords"]))
{
$_POST['keywords']=str_replace("",",",$_POST["keywords"]);
}
else
{
if(!empty($_POST["title"]))
{
$title=$_POST["title"];
$title=str_replace("","",$title);
$title=str_replace(",","",$title);
$_POST['keywords']=get_keywords($title);//标题分词
}
}
if(isset($_POST["dellink"]) && $_POST["dellink"]==1 && !empty($content)){$content=replacelinks($content,array(CMS_BASEHOST));} //删除非站内链接
$_POST['body']=$content;
//提取第一个图片为缩略图
if(isset($_POST["autolitpic"]) && $_POST["autolitpic"] && empty($litpic))
{
if(getfirstpic($content))
{
//获取文章内容的第一张图片
$imagepath = '.'.getfirstpic($content);
//获取后缀名
preg_match_all ("/\/(.+)\.(gif|jpg|jpeg|bmp|png)$/iU",$imagepath,$out, PREG_PATTERN_ORDER);
$saveimage='./uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0];
//生成缩略图,按照原图的比例生成一个最大为240*180的缩略图
\Intervention\Image\Facades\Image::make($imagepath)->resize(sysconfig('CMS_IMGWIDTH'), sysconfig('CMS_IMGHEIGHT'))->save($saveimage);
//缩略图路径
$_POST['litpic']='/uploads/'.date('Y/m',time()).'/'.basename($imagepath,'.'.$out[2][0]).'-lp.'.$out[2][0];
}
}
unset($_POST["dellink"]);
unset($_POST["autolitpic"]);
unset($_POST["_token"]);
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if(DB::table('article')->where('id', $id)->update($_POST))
{
success_jump("修改成功!", route('admin_article'));
}
else
{
error_jump("修改失败!");
}
}
//删除文章
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump("删除失败!请重新提交");}
if(DB::table("article")->whereIn("id", explode(',', $id))->delete())
{
success_jump("$id ,删除成功");
}
else
{
error_jump("$id ,删除失败!请重新提交");
}
}
//重复文章列表
public function repetarc()
{
$data['posts'] = object_to_array(DB::table('article')->select(DB::raw('title,count(*) AS count'))->orderBy('count', 'desc')->groupBy('title')->having('count', '>', 1)->get());
return view('admin.article.repetarc', $data);
}
//推荐文章
public function recommendarc()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump("您访问的页面不存在或已被删除!");} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
$data['tuijian'] = 1;
if(DB::table("article")->whereIn("id", explode(',', $id))->update($data))
{
success_jump("$id ,推荐成功");
}
else
{
error_jump("$id ,推荐失败!请重新提交");
}
}
//检测重复文章数量
public function articleexists()
{
$res = '';
$where = function ($query) use ($res) {
if(isset($_REQUEST["title"]))
{
$query->where('title', $_REQUEST["title"]);
}
if(isset($_REQUEST["id"]))
{
$query->where('id', '<>', $_REQUEST["id"]);
}
};
return DB::table("article")->where($where)->count();
}
}

123
app/Http/Controllers/Admin/CategoryController.php

@ -0,0 +1,123 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class CategoryController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
return view('admin.category.index');
}
public function add()
{
if(!empty($_GET["reid"]))
{
$id = $_GET["reid"];
if(preg_match('/[0-9]*/',$id)){}else{exit;}
if($id!=0)
{
$data['postone'] = object_to_array(DB::table("arctype")->where('id', $id)->first(), 1);
}
$data['id'] = $id;
}
else
{
$data['id'] = 0;
}
return view('admin.category.add', $data);
}
public function doadd()
{
if(!empty($_POST["prid"])){if($_POST["prid"]=="top"){$_POST['reid']=0;}else{$_POST['reid'] = $_POST["prid"];}}//父级栏目id
$_POST['addtime'] = time();//添加时间
unset($_POST["prid"]);
unset($_POST["_token"]);
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if(DB::table('arctype')->insert($_POST))
{
success_jump('添加成功!');
}
else
{
error_jump('添加失败!请修改后重新添加');
}
}
public function edit()
{
$id = $_GET["id"];if(preg_match('/[0-9]*/',$id)){}else{exit;}
$data['id'] = $id;
$post = object_to_array(DB::table('arctype')->where('id', $id)->first(), 1);
$reid = $post['reid'];
if($reid!=0){$data['postone'] = object_to_array(DB::table('arctype')->where('id', $reid)->first());}
$data['post'] = $post;
return view('admin.category.edit', $data);
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;}
$_POST['addtime'] = time(); //添加时间
unset($_POST["_token"]);
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if(DB::table('arctype')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_category'));
}
else
{
error_jump('修改失败!请修改后重新添加');
}
}
public function del()
{
if(!empty($_REQUEST["id"])){$id = $_REQUEST["id"];}else{error_jump('删除失败!请重新提交');} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
if(DB::table('arctype')->where('reid', $id)->first())
{
error_jump('删除失败!请先删除子栏目');
}
else
{
if(DB::table('arctype')->where('id', $id)->delete())
{
if(DB::table("article")->where('typeid', $id)->count()>0) //判断该分类下是否有文章,如果有把该分类下的文章也一起删除
{
if(DB::table("article")->where('typeid', $id)->delete())
{
success_jump('删除成功');
}
else
{
error_jump('栏目下的文章删除失败!');
}
}
else
{
success_jump('删除成功');
}
}
else
{
error_jump('删除失败!请重新提交');
}
}
}
}

54
app/Http/Controllers/Admin/CommonController.php

@ -0,0 +1,54 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use DB;
class CommonController extends Controller
{
public $user_info;
public function __construct()
{
parent::__construct();
if(isset($_SESSION['admin_user_info']))
{
$this->user_info = $_SESSION['admin_user_info'];
}
else
{
header("Location:".route('page404'));
exit();
}
}
/**
* 获取分页数据及分页导航
* @param string $modelname 模块名与数据库表名对应
* @param array $map 查询条件
* @param string $orderby 查询排序
* @param string $field 要返回数据的字段
* @param int $listRows 每页数量,默认10条
*
* @return 格式化后输出的数据。内容格式为:
* - "code" (string):代码
* - "info" (string):信息提示
*
* - "result" array
*
* - "img_list" (array) :图片队列,默认8张
* - "img_title" (string):车图名称
* - "img_url" (string):车图片url地址
* - "car_name" (string):车名称
*/
public function pageList($modelname, $map = '', $orderby = '', $field = '', $listRows = 15)
{
$orderby = !empty($orderby) ? $orderby : $orderby = ['id', 'desc'];
// 查询满足的数据,并且每页显示15条数据
$voList = DB::table($modelname)->where($map)->orderBy($orderby[0], $orderby[1])->paginate($listRows);
return $voList;
}
}

35
app/Http/Controllers/Admin/IndexController.php

@ -0,0 +1,35 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
class IndexController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
return view('admin.index.index');
}
//更新配置
public function upconfig()
{
updateconfig();
}
//更新缓存
public function upcache()
{
}
//页面跳转
public function jump()
{
return view('admin.index.jump');
}
}

95
app/Http/Controllers/Admin/LoginController.php

@ -0,0 +1,95 @@
<?php
namespace App\Http\Controllers\Admin;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Http\Model\User;
use Log;
class LoginController extends BaseController
{
/**
* 登录页面
*/
public function login()
{
if(isset($_SESSION['admin_user_info']))
{
header("Location: ".route('admin'));
exit;
}
return view('admin.login.login');
}
/**
* 登录处理页面
*/
public function dologin()
{
if(!empty($_POST["username"])){$username = $_POST["username"];}else{$username='';exit;}//用户名
if(!empty($_POST["pwd"])){$pwd = md5($_POST["pwd"]);}else{$pwd='';exit;}//密码
$User = User::where(['username' => $username, 'pwd' => $pwd])->orWhere(['email' => $username, 'pwd' => $pwd])->first();
if($User)
{
$admin_user_info = $User->toArray();
$admin_user_info['rolename'] = $User->userrole->rolename;
$_SESSION['admin_user_info'] = $admin_user_info;
$User->logintime = time();
$User->save();
return redirect()->route('admin');
}
else
{
return redirect()->route('admin_login');
}
}
//退出登录
public function logout()
{
session_unset();
session_destroy();// 退出登录,清除session
success_jump('退出成功!', route('home'));
}
//密码恢复
public function recoverpwd()
{
$data["username"] = "admin888";
$data["pwd"] = "21232f297a57a5a743894a0e4a801fc3";
if(DB::table('user')->where('id', 1)->update($data))
{
success_jump('密码恢复成功!', route('admin_login'));
}
else
{
error_jump('密码恢复失败!', route('home'));
}
}
/**
* 判断用户名是否存在
*/
public function userexists()
{
$map['username'] = "";
if(isset($_POST["username"]) && !empty($_POST["username"]))
{
$map['username'] = $_POST["username"];
}
else
{
return 0;
}
return DB::table("user")->where($map)->count();
}
}

85
app/Http/Controllers/Admin/PageController.php

@ -0,0 +1,85 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
class PageController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$data['posts'] = object_to_array(DB::table("page")->orderBy('id', 'desc')->get());
return view('admin.page.index', $data);
}
public function doadd()
{
$_POST['pubdate'] = time();//更新时间
$_POST['click'] = rand(200,500);//点击
unset($_POST["_token"]);
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if(DB::table("page")->insert($_POST))
{
success_jump('添加成功!');
}
else
{
error_jump('添加失败!请修改后重新添加');
}
}
public function add()
{
return view('admin.page.add');
}
public function edit()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";}
if(preg_match('/[0-9]*/',$id)){}else{exit;}
$data['id'] = $id;
$data['post'] = object_to_array(DB::table('page')->where('id', $id)->first(), 1);
return view('admin.page.edit', $data);
}
public function doedit()
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else {$id="";exit;}
$_POST['pubdate'] = time();//更新时间
unset($_POST["_token"]);
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
if(DB::table('page')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_page'));
}
else
{
error_jump('修改失败!请修改后重新添加');
}
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump("删除失败!请重新提交");} //if(preg_match('/[0-9]*/',$id)){}else{exit;}
if(DB::table('page')->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
else
{
error_jump("删除失败!请重新提交");
}
}
}

44
app/Http/Controllers/Controller.php

@ -1,13 +1,47 @@
<?php <?php
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController; use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Support\Facades\DB;
use Log;
class Controller extends BaseController class Controller extends BaseController
{ {
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function __construct()
{
}
/**
* 获取当前控制器名
*
* @return string
*/
public function getCurrentControllerName()
{
return self::getCurrentAction()['controller'];
}
/**
* 获取当前方法名
*
* @return string
*/
public function getCurrentMethodName()
{
return self::getCurrentAction()['method'];
}
/**
* 获取当前控制器与方法
*
* @return array
*/
public function getCurrentAction()
{
$action = \Route::current()->getActionName();
list($class, $method) = explode('@', $action);
return ['controller' => $class, 'method' => $method];
}
} }

12
app/Http/Controllers/Home/CommonController.php

@ -0,0 +1,12 @@
<?php
namespace App\Http\Controllers\Home;
use App\Http\Controllers\Controller;
class CommonController extends Controller
{
public function __construct()
{
parent::__construct();
}
}

33
app/Http/Controllers/Home/IndexController.php

@ -1,23 +1,36 @@
<?php <?php
namespace App\Http\Controllers\Home; namespace App\Http\Controllers\Home;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Home\CommonController;
use App\Http\Model\Article;
use App\Http\Model\Arctype;
use Illuminate\Support\Facades\DB;
class IndexController extends Controller
class IndexController extends CommonController
{ {
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct() public function __construct()
{ {
//$this->middleware('guest')->except('logout');
parent::__construct();
} }
public function index() public function index()
{ {
dd('home/index');
$user = DB::table('article')->where('id', '1')->first();
echo $user->title;
//$Article = Article::find(1)->arctype;
//$Article = Article::find(1);
//$Article = Arctype::find(1)->article()->get()->toArray();
//$comment = Article::find(1)->arctype()->first()->toArray();
//echo $comment->arctype->typename;
//print_r($comment);
//dd($comment);
}
public function page404()
{
return view('home.404');
} }
} }

4
app/Http/Controllers/Wap/IndexController.php

@ -2,9 +2,9 @@
namespace App\Http\Controllers\Wap; namespace App\Http\Controllers\Wap;
use App\Http\Controllers\Controller;
use App\Http\Controllers\CommonController;
class IndexController extends Controller
class IndexController extends CommonController
{ {
/** /**
* Create a new controller instance. * Create a new controller instance.

2
app/Http/Kernel.php

@ -56,5 +56,7 @@ class Kernel extends HttpKernel
'can' => \Illuminate\Auth\Middleware\Authorize::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'check.login' => \App\Http\Middleware\CheckLogin::class,
]; ];
} }

28
app/Http/Middleware/CheckLogin.php

@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Closure;
class CheckLogin
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if(!session()->has('admin_user_info'))
{
redirect()->route('admin_login');
}
else
{
}
return $next($request);
}
}

41
app/Http/Model/Arctype.php

@ -0,0 +1,41 @@
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
class Arctype extends Model
{
//文章分类模型
/**
* 关联到模型的数据表
*
* @var string
*/
protected $table = 'arctype';
public $timestamps = false;
/**
* 表明模型是否应该被打上时间戳
* 默认情况下,Eloquent 期望 created_at 和updated_at 已经存在于数据表中,如果你不想要这些 Laravel 自动管理的数据列,在模型类中设置 $timestamps 属性为 false
*
* @var bool
*/
public $timestamps = false;
/**
* The connection name for the model.
* 默认情况下,所有的 Eloquent 模型使用应用配置中的默认数据库连接,如果你想要为模型指定不同的连接,可以通过 $connection 属性来设置
* @var string
*/
//protected $connection = 'connection-name';
/**
* 获取分类对应的文章
*/
public function article()
{
return $this->hasMany(Article::class, 'typeid', 'id');
}
}

61
app/Http/Model/Article.php

@ -0,0 +1,61 @@
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
//文章模型
/**
* 关联到模型的数据表
*
* @var string
*/
protected $table = 'article';
/**
* 表明模型是否应该被打上时间戳
* 默认情况下,Eloquent 期望 created_at 和updated_at 已经存在于数据表中,如果你不想要这些 Laravel 自动管理的数据列,在模型类中设置 $timestamps 属性为 false
*
* @var bool
*/
public $timestamps = false;
//protected $guarded = []; //$guarded包含你不想被赋值的字段数组。
//protected $fillable = ['name']; //定义哪些字段是可以进行赋值的,与$guarded相反
/**
* The connection name for the model.
* 默认情况下,所有的 Eloquent 模型使用应用配置中的默认数据库连接,如果你想要为模型指定不同的连接,可以通过 $connection 属性来设置
* @var string
*/
//protected $connection = 'connection-name';
/**
* 文件上传
* @param $field
* @return string
*/
public static function uploadImg($field)
{
if (Request::hasFile($field)) {
$pic = Request::file($field);
if ($pic->isValid()) {
$newName = md5(rand(1, 1000) . $pic->getClientOriginalName()) . "." . $pic->getClientOriginalExtension();
$pic->move('uploads', $newName);
return $newName;
}
}
return '';
}
/**
* 获取关联到文章的分类
*/
public function arctype()
{
return $this->belongsTo(Arctype::class, 'typeid', 'id');
}
}

17
app/Http/Model/Sysconfig.php

@ -0,0 +1,17 @@
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
class Sysconfig extends Model
{
protected $table = 'sysconfig';
public $timestamps = false;
/**
* 不能被批量赋值的属性
*
* @var array
*/
protected $guarded = [];
}

25
app/Http/Model/User.php

@ -5,28 +5,21 @@ use Illuminate\Database\Eloquent\Model;
class User extends Model class User extends Model
{ {
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
protected $table = 'user';
public $timestamps = false;
/** /**
* The attributes that should be hidden for arrays.
* 不能被批量赋值的属性
* *
* @var array * @var array
*/ */
protected $hidden = [
'password', 'remember_token',
];
protected $guarded = [];
/** /**
* 不能被批量赋值的属性
*
* @var array
* 获取关联到用户的角色
*/ */
protected $guarded = [];
public function userrole()
{
return $this->belongsTo(UserRole::class, 'role_id', 'id');
}
} }

25
app/Http/Model/UserRole.php

@ -0,0 +1,25 @@
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
class UserRole extends Model
{
protected $table = 'user_role';
public $timestamps = false;
/**
* 不能被批量赋值的属性
*
* @var array
*/
protected $guarded = [];
/**
* 获取角色对应的用户
*/
public function user()
{
return $this->hasMany(User::class, 'role_id', 'id');
}
}

5
composer.json

@ -6,10 +6,11 @@
"type": "project", "type": "project",
"require": { "require": {
"php": ">=5.6.4", "php": ">=5.6.4",
"intervention/image": "^2.3",
"laravel/framework": "5.4.*", "laravel/framework": "5.4.*",
"overtrue/laravel-wechat": "~3.1",
"laravel/tinker": "~1.0",
"maatwebsite/excel": "~2.1.0", "maatwebsite/excel": "~2.1.0",
"laravel/tinker": "~1.0"
"overtrue/laravel-wechat": "~3.1"
}, },
"require-dev": { "require-dev": {
"fzaninotto/faker": "~1.4", "fzaninotto/faker": "~1.4",

64
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "5fb27d16232b4890e5783a0fd2f70f79",
"content-hash": "2367b038aae2731238e00c910f6f6cc3",
"packages": [ "packages": [
{ {
"name": "dnoegel/php-xdg-base-dir", "name": "dnoegel/php-xdg-base-dir",
@ -396,6 +396,68 @@
], ],
"time": "2017-03-20T17:10:46+00:00" "time": "2017-03-20T17:10:46+00:00"
}, },
{
"name": "intervention/image",
"version": "2.3.13",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
"reference": "15a517f052ee15d373ffa145c9642d5fec7ddf5c"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/Intervention/image/15a517f052ee15d373ffa145c9642d5fec7ddf5c.zip",
"reference": "15a517f052ee15d373ffa145c9642d5fec7ddf5c",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"guzzlehttp/psr7": "~1.1",
"php": ">=5.4.0"
},
"require-dev": {
"mockery/mockery": "~0.9.2",
"phpunit/phpunit": "3.*"
},
"suggest": {
"ext-gd": "to use GD library based image processing.",
"ext-imagick": "to use Imagick based image processing.",
"intervention/imagecache": "Caching extension for the Intervention Image library"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3-dev"
}
},
"autoload": {
"psr-4": {
"Intervention\\Image\\": "src/Intervention/Image"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Oliver Vogel",
"email": "oliver@olivervogel.net",
"homepage": "http://olivervogel.net/"
}
],
"description": "Image handling and manipulation library with support for Laravel integration",
"homepage": "http://image.intervention.io/",
"keywords": [
"gd",
"image",
"imagick",
"laravel",
"thumbnail",
"watermark"
],
"time": "2017-04-23T18:45:36+00:00"
},
{ {
"name": "jakub-onderka/php-console-color", "name": "jakub-onderka/php-console-color",
"version": "0.1", "version": "0.1",

4
config/app.php

@ -64,7 +64,7 @@ return [
| |
*/ */
'timezone' => 'UTC',
'timezone' => 'Asia/Shanghai',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -162,6 +162,7 @@ return [
Illuminate\Translation\TranslationServiceProvider::class, Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class, Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class, Illuminate\View\ViewServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
/* /*
* Package Service Providers... * Package Service Providers...
@ -225,6 +226,7 @@ return [
'URL' => Illuminate\Support\Facades\URL::class, 'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class, 'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class, 'View' => Illuminate\Support\Facades\View::class,
'Image' => Intervention\Image\Facades\Image::class, //图片处理
], ],

12
config/custom.php

@ -0,0 +1,12 @@
<?php
//自定义配置
return [
//等级推荐
"tuijian" => [
"0"=>"不推荐",
"1"=>"一级推荐",
"2"=>"二级推荐",
"3"=>"三级推荐",
"4"=>"四级推荐"
],
];

2
config/database.php

@ -49,7 +49,7 @@ return [
'unix_socket' => env('DB_SOCKET', ''), 'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4', 'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci', 'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix' => env('DB_PREFIX', 'fl_'),
'strict' => true, 'strict' => true,
'engine' => null, 'engine' => null,
], ],

2
public/index.php

@ -19,6 +19,8 @@
| |
*/ */
session_start(); //开启session
require __DIR__.'/../bootstrap/autoload.php'; require __DIR__.'/../bootstrap/autoload.php';
/* /*

164
resources/views/admin/article/add.blade.php

@ -0,0 +1,164 @@
<!DOCTYPE html><html><head><title>发布文章_后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h5 class="sub-header"><a href="/fladmin/article">文章列表</a> > 发布文章</h5>
<form id="addarc" method="post" action="/fladmin/article/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">文章标题:</td>
<td><input name="title" type="text" id="title" value="" class="required" style="width:60%" placeholder="在此输入标题"></td>
</tr>
<tr>
<td align="right">是否审核:</td>
<td>
<input type="radio" value='0' name="ischeck" checked />&nbsp;&nbsp;&nbsp;
<input type="radio" value='1' name="ischeck" />&nbsp;
</td>
</tr>
<tr>
<td align="right">推荐:</td>
<td>
<select name="tuijian" id="tuijian">
<?php $tuijian = config('custom.tuijian');
for($i=0;$i<count($tuijian);$i++){?><option value="<?php echo $i; ?>"><?php echo $tuijian[$i]; ?></option><?php } ?>
</select>
</td>
</tr>
<tr>
<td align="right">seoTitle:</td>
<td><input name="seotitle" type="text" id="seotitle" value="" style="width:60%"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">来源:</td>
<td colspan="2"><input name="source" type="text" id="source" style="width:160px" value="" size="16">&nbsp;&nbsp; 作者:<input name="writer" type="text" id="writer" style="width:100px" value="">&nbsp;&nbsp; 浏览次数:<input type="text" name="click" id="click" value="<?php echo rand(200,500); ?>" style="width:80px;"></td>
</tr>
<tr>
<td align="right">文章栏目:</td>
<td>
<select name="typeid" id="typeid">
<?php $catlist = category_tree(get_category('arctype',0));foreach($catlist as $row){
if($row["id"]==$catid){ ?>
<option selected="selected" value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["typename"]; ?></option>
<?php }else{ ?>
<option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["typename"]; ?></option>
<?php }} ?>
</select>
</td>
</tr>
<tr>
<td align="right">关键词:</td>
<td><input type="text" name="keywords" id="keywords" style="width:50%" value=""> (多个用","分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">内容摘要:</td>
<td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"></textarea></td>
</tr>
<tr>
<td align="right">附加选项:</td>
<td>
<input name="dellink" type="checkbox" class="np" id="dellink" value="1">
删除非站内链接
<input name="autolitpic" type="checkbox" class="np" id="autolitpic" value="1" checked="1">
提取第一个图片为缩略图
</td>
</tr>
<tr>
<td colspan="2"><strong>文章内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain"></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td>
</tr>
</tbody></table></form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
<script>
$(function(){
$(".required").blur(function(){
var $parent = $(this).parent();
$parent.find(".formtips").remove();
if(this.value=="")
{
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
}
else
{
var title = $("#title").val();
$.ajax({
url: <?php echo route('admin_article_articleexists'); ?>,
type: "GET",
cache: false,
data: {
"title":title
},
success: function(data){
if(data>0)
{
$parent.append(' <small class="formtips onSuccess"><font color="green">已经存在</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
});
}
});
//重置
$('#addarc input[type="reset"]').click(function(){
$(".formtips").remove();
});
$("#addarc").submit(function(){
$(".required").trigger('blur');
var numError = $('#addarc .onError').length;
if(numError){return false;}
});
});
</script>
</body></html>

147
resources/views/admin/article/edit.blade.php

@ -0,0 +1,147 @@
<!DOCTYPE html><html><head><title>修改文章_后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h5 class="sub-header"><a href="/fladmin/article">文章列表</a> > 修改文章</h5>
<form id="addarc" method="post" action="/fladmin/article/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">文章标题:</td>
<td><input name="title" type="text" id="title" value="<?php echo $post["title"]; ?>" class="required" style="width:60%" placeholder="在此输入标题"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td align="right">是否审核:</td>
<td>
<input type="radio" value='0' name="ischeck" <?php if($post['ischeck']==0){ echo 'checked'; } ?> />&nbsp;是&nbsp;&nbsp;
<input type="radio" value='1' name="ischeck" <?php if($post['ischeck']==1){ echo 'checked'; } ?> />&nbsp;否
</td>
</tr>
<tr>
<td align="right">推荐:</td>
<td>
<select name="tuijian" id="tuijian">
<?php $tuijian = config('custom.tuijian');
for($i=0;$i<count($tuijian);$i++){if($i==$post["tuijian"]){?><option selected="selected" value="<?php echo $i; ?>"><?php echo $tuijian[$i]; ?></option>
<?php }else{?><option value="<?php echo $i; ?>"><?php echo $tuijian[$i]; ?></option><?php }} ?>
</select>
</td>
</tr>
<tr>
<td align="right">seoTitle:</td>
<td><input name="seotitle" type="text" id="seotitle" value="<?php echo $post["seotitle"]; ?>" style="width:60%"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="<?php echo $post["litpic"]; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["litpic"]) || !imgmatch($post["litpic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["litpic"])){echo $post["litpic"];} ?>" width="120" height="80" id="picview" name="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">来源:</td>
<td colspan="2"><input name="source" type="text" id="source" style="width:160px" value="<?php echo $post["source"]; ?>" size="16">&nbsp;&nbsp; 作者:<input name="writer" type="text" id="writer" style="width:100px" value="<?php echo $post["writer"]; ?>">&nbsp;&nbsp; 浏览次数:<input type="text" name="click" id="click" value="<?php echo rand(200,500); ?>" style="width:80px;"></td>
</tr>
<tr>
<td align="right">文章栏目:</td>
<td>
<select name="typeid" id="typeid">
<?php $catlist = category_tree(get_category('arctype',0));foreach($catlist as $row){
if($row["id"]==$post["typeid"]){ ?>
<option selected="selected" value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["typename"]; ?></option>
<?php }else{ ?>
<option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["typename"]; ?></option>
<?php }} ?>
</select>
</td>
</tr>
<tr>
<td align="right">关键词:</td>
<td><input type="text" name="keywords" id="keywords" style="width:50%" value="<?php echo $post["keywords"]; ?>"> (多个用","分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">内容摘要:</td>
<td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"><?php echo $post["description"]; ?></textarea></td>
</tr>
<tr>
<td align="right">附加选项:</td>
<td>
<input name="dellink" type="checkbox" class="np" id="dellink" value="1">
删除非站内链接
<input name="autolitpic" type="checkbox" class="np" id="autolitpic" value="1" checked>
提取第一个图片为缩略图
</td>
</tr>
<tr>
<td colspan="2"><strong>文章内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain"><?php echo $post["body"]; ?></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td>
</tr>
</tbody></table></form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
<script>
$(function(){
$(".required").blur(function(){
var $parent = $(this).parent();
$parent.find(".formtips").remove();
if(this.value=="")
{
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
});
//重置
$('#addarc input[type="reset"]').click(function(){
$(".formtips").remove();
});
$("#addarc").submit(function(){
$(".required").trigger('blur');
var numError = $('#addarc .onError').length;
if(numError){return false;}
});
});
</script>
</body></html>

115
resources/views/admin/article/index.blade.php

@ -0,0 +1,115 @@
<!DOCTYPE html><html><head><title>文章列表_<?php echo sysconfig('CMS_WEBNAME'); ?>后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox"><h5 class="sub-header"><a href="/fladmin/category">栏目管理</a> > <a href="/fladmin/article">文章列表</a> [ <a href="/fladmin/article/add<?php if(!empty($_GET["id"])){echo '?catid='.$_GET["id"];}?>">发布文章</a> ]</h5>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th>选择</th>
<th>文章标题</th>
<th>更新时间</th>
<th>类目</th><th>点击</th><th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach($posts as $row){ ?>
<tr>
<td><?php echo $row->id; ?></td>
<td><input name="arcID" type="checkbox" value="<?php echo $row->id; ?>" class="np"></td>
<td><a href="/fladmin/article/edit?id=<?php echo $row->id; ?>"><?php echo $row->title; ?></a> <?php if(!empty($row->litpic)){echo "<small style='color:red'>[图]</small>";}if($row->tuijian==1){echo "<small style='color:#22ac38'>[荐]</small>";} ?> </td>
<td><?php echo date('Y-m-d',$row->pubdate); ?></td>
<td><a href="/fladmin/article?id=<?php echo $row->typeid; ?>"><?php echo $row->typename; ?></a></td><td><?php echo $row->click; ?></td><td><a target="_blank" href="<?php echo get_front_url(array("type"=>"content","catid"=>$row->typeid,"id"=>$row->id)); ?>">预览</a>&nbsp;<a href="/fladmin/article/edit?id=<?php echo $row->id; ?>">修改</a>&nbsp;<a onclick="delconfirm('/fladmin/article/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
</tr>
<?php } ?>
<tr>
<td colspan="8">
<a href="javascript:selAll('arcID')" class="coolbg">反选</a>&nbsp;
<a href="javascript:delArc()" class="coolbg">删除</a>&nbsp;
<a href="javascript:tjArc()" class="coolbg">特荐</a>
</td>
</tr>
</tbody>
</table>
</div><!-- 表格结束 -->
<form id="searcharc" class="navbar-form" action="/fladmin/article" method="get">
<select name="typeid" id="typeid" style="padding:6px 5px;vertical-align:middle;border:1px solid #DBDBDB;border-radius:4px;">
<option value="0">选择栏目...</option>
<?php $catlist = category_tree(get_category('arctype', 0)); foreach($catlist as $row) { ?><option value="<?php echo $row['id']; ?>"><?php for($i=0; $i<$row["deep"]; $i++) { echo "—"; } echo $row["typename"]; ?></option><?php } ?>
</select>
<div class="form-group"><input type="text" name="keyword" id="keyword" class="form-control required" placeholder="搜索关键词..."></div>
<button type="submit" class="btn btn-info" value="Submit">搜索一下</button></form>
<div class="backpages">{{ $posts->links() }}</div>
<script>
//推荐文章
function tjArc(aid)
{
var checkvalue=getItems();
if(checkvalue=='')
{
alert('必须选择一个或多个文档!');
return;
}
if(confirm("确定要推荐吗"))
{
location="/fladmin/article/recommendarc?id="+checkvalue;
}
else
{
}
}
//批量删除文章
function delArc(aid)
{
var checkvalue=getItems();
if(checkvalue=='')
{
alert('必须选择一个或多个文档!');
return;
}
if(confirm("确定删除吗"))
{
location="/fladmin/article/del?id="+checkvalue;
}
else
{
}
}
$(function(){
$('.required').on('focus', function() {
$(this).removeClass('input-error');
});
$("#searcharc").submit(function(e){
$(this).find('.required').each(function(){
if( $(this).val() == "" )
{
e.preventDefault();
$(this).addClass('input-error');
}
else
{
$(this).removeClass('input-error');
}
});
});
});
</script>
</div></div><!-- 右边结束 --></div></div>
</body></html>

26
resources/views/admin/article/repetarc.blade.php

@ -0,0 +1,26 @@
<!DOCTYPE html><html><head><title>重复文档列表_后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h2 class="sub-header">重复文档列表</h2>[ <a href="/fladmin/article">文章列表</a> ] [ <a href="/fladmin/article/add">发布文章</a> ]<br><br>
<form name="listarc">
<div class="table-responsive"><table class="table table-striped table-hover">
<thead><tr>
<th>文档标题</th>
<th>重复数量</th>
</tr></thead>
<tbody>
<?php if($posts){ foreach ($posts as $row) { ?>
<tr>
<td><a href="/fladmin/article/index?typeid=0&keyword=<?php echo $row["title"]; ?>"><?php echo $row["title"]; ?></a></td>
<td><?php echo $row["count"]; ?></td>
</tr>
<?php }} ?>
</tbody>
</table></div><!-- 表格结束 --></form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
</body></html>

145
resources/views/admin/category/add.blade.php

@ -0,0 +1,145 @@
<!DOCTYPE html><html><head><title>添加栏目_后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h5 class="sub-header"><a href="/fladmin/category">栏目管理</a> > 栏目添加</h5>
<form method="post" action="/fladmin/category/doadd" role="form" id="addcat" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">栏目名称:</td>
<td><input name="typename" type="text" id="typename" size="30" class="required"></td>
</tr>
<tr>
<td align="right">上级目录:</td>
<td><?php if($id==0){echo "顶级栏目";}else{echo $postone["typename"];} ?><input style="display:none;" type="text" name="prid" id="prid" value="<?php if($id==0){echo "top";}else{echo $id;} ?>"></td>
</tr>
<tr>
<td align="right">别名:</td>
<td><input name="typedir" type="text" id="typedir" class="required" style="width:30%"> <small>(包含字母或数字,字母开头)</small></td>
</tr>
<tr>
<td align="right">列表模板:</td>
<td><input name="templist" id="templist" type="text" value="category" class="required" style="width:300px"></td>
</tr>
<tr>
<td align="right">文章模板:</td>
<td><input name="temparticle" id="temparticle" type="text" value="detail" class="required" style="width:300px"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">SEO标题:</td>
<td><input name="seotitle" type="text" style="width:70%" id="seotitle" class="alltxt" value=""></td>
</tr>
<tr>
<td align="right">关键字:</td>
<td><input name="keywords" type="text" style="width:50%" id="keywords" class="alltxt" value=""> (","分开)</td>
</tr>
<tr>
<td align="right">SEO关键字:</td>
<td><input name="seokeyword" type="text" style="width:50%" id="seokeyword" class="alltxt" value=""> (","分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">栏目描述:</td>
<td><textarea name="description" cols="70" style="height:70px;vertical-align:middle;width:70%" rows="3" id="description" class="alltxt"></textarea></td>
</tr>
<tr>
<td colspan="2"><strong>栏目内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="content" type="text/plain"></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" class="btn btn-success" value="保存(Submit)">&nbsp;&nbsp;<input type="reset" class="btn btn-default" value="重置(Reset)"></td>
</tr>
</tbody>
</table>
</form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
<script>
$(function(){
$(".required").blur(function(){
var $parent = $(this).parent();
$parent.find(".formtips").remove();
if(this.value=="")
{
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
}
else
{
if( $(this).is('#typedir') ){
var reg = /^[a-zA-Z]+[0-9]*[a-zA-Z0-9]*$/;//验证是否为字母、数字
if(!reg.test($("#typedir").val()))
{
$parent.append(' <small class="formtips onError"><font color="red">格式不正确!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
});
//重置
$('#addcat input[type="reset"]').click(function(){
$(".formtips").remove();
});
});
$('#addcat input[type="submit"]').click(function(){
$(".required").trigger('blur');
var numError = $('#addcat .onError').length;
if(numError){
return false;
}
});
</script>
</body></html>

21
resources/views/admin/category/index.blade.php

@ -0,0 +1,21 @@
<!DOCTYPE html><html><head><title>栏目列表_后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h2 class="sub-header">网站栏目管理</h2>[ <a href="/fladmin/category/add">增加顶级栏目</a> ] [ <a href="/fladmin/article/add">发布文章</a> ]<br><br>
<form name="listarc"><div class="table-responsive">
<table class="table table-striped table-hover">
<thead><tr><th>ID</th><th>名称</th><th>文章数</th><th>别名</th><th>更新时间</th><th>操作</th></tr></thead>
<tbody id="cat-list">
<?php $catlist = category_tree(get_category('arctype',0));foreach($catlist as $row){ ?>
<tr id="cat-<?php echo $row["id"]; ?>">
<td><?php echo $row["id"]; ?></td>
<td><a href="/fladmin/article?id=<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["typename"]; ?></a></td><td><?php echo catarcnum($row["id"],'article'); ?></td><td><?php echo $row["typedir"]; ?></td><td><?php echo date('Y-m-d',$row["addtime"]); ?></td>
<td><a href="<?php echo get_front_url(array("type"=>"list","catid"=>$row["id"])); ?>" target="_blank">预览</a> | <a href="/fladmin/article/add?catid=<?php echo $row["id"]; ?>">发布文章</a> | <a href="/fladmin/category/add?reid=<?php echo $row["id"]; ?>">增加子类</a> | <a href="/fladmin/category/edit?id=<?php echo $row["id"]; ?>">更改</a> | <a onclick="delconfirm('/fladmin/category/del?id=<?php echo $row["id"]; ?>')" href="javascript:;">删除</a></td>
</tr><?php } ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
</body></html>

12
resources/views/admin/common/header.blade.php

@ -0,0 +1,12 @@
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="<?php echo route('home'); ?>/css/bootstrap.min.css"><link rel="stylesheet" href="<?php echo route('home'); ?>/css/admin.css">
<script src="<?php echo route('home'); ?>/js/jquery.min.js"></script><script src="/js/ad.js"></script><script src="<?php echo route('home'); ?>/js/bootstrap.min.js"></script><script type="text/javascript" src="<?php echo route('home'); ?>/js/jquery.uploadify.min.js"></script></head><body>
<div class="blog-masthead clearfix"><nav class="blog-nav">
<a class="blog-nav-item active" href="<?php echo route('admin'); ?>"><span class="glyphicon glyphicon-star"></span> <strong>后台管理中心</strong> <span class="glyphicon glyphicon-star-empty"></span></a>
<a class="blog-nav-item" href="<?php echo route('home'); ?>" target="_blank"><span class="glyphicon glyphicon-home"></span> 网站主页</a>
<a class="blog-nav-item" href="<?php echo route('admin'); ?>/index/upcache"><span class="glyphicon glyphicon-refresh"></span> 更新缓存</a>
<a class="blog-nav-item" id="navexit" href="<?php echo route('admin_logout'); ?>"><span class="glyphicon glyphicon-off"></span> 注销</a>
<a class="blog-nav-item pull-right" href="javascript:;"><small>您好:<span class="glyphicon glyphicon-user"></span> <?php if(isset($_SESSION['admin_user_info'])){echo $_SESSION['admin_user_info']['username'].' ['.$_SESSION['admin_user_info']['rolename'].']';} ?></small></a>
</nav></div>

26
resources/views/admin/common/leftmenu.blade.php

@ -0,0 +1,26 @@
<dl class="lnav">
<dt>常用操作</dt>
<dd><a href="<?php echo route('admin'); ?>/category"><span class="glyphicon glyphicon-th-list"></span> 网站栏目管理</a></dd>
<dd><a href="<?php echo route('admin'); ?>/article"><span class="glyphicon glyphicon-pencil"></span> 文章列表</a></dd>
<dd><a href="<?php echo route('admin'); ?>/article?ischeck=1"><span class="glyphicon glyphicon-pencil"></span> 未审核的文章</a></dd>
<dd><a href="<?php echo route('admin'); ?>/article/add"><span class="glyphicon glyphicon-file"></span> 发布文章</a></dd>
<dd><a href="<?php echo route('admin'); ?>/page"><span class="glyphicon glyphicon-equalizer"></span> 单页文档管理</a></dd>
<dt>商品管理</dt>
<dd><a href="<?php echo route('admin'); ?>/product"><span class="glyphicon glyphicon-pencil"></span> 商品列表</a></dd>
<dd><a href="<?php echo route('admin'); ?>/product/add"><span class="glyphicon glyphicon-file"></span> 添加商品</a></dd>
<dd><a href="<?php echo route('admin'); ?>/productType"><span class="glyphicon glyphicon-th-list"></span> 商品分类</a></dd>
<dt>批量维护</dt>
<dd><a href="<?php echo route('admin'); ?>/tag"><span class="glyphicon glyphicon-tag"></span> TAG标签管理</a></dd>
<dd><a href="<?php echo route('admin'); ?>/search"><span class="glyphicon glyphicon-fire"></span> 关键词管理</a></dd>
<dd><a href="<?php echo route('admin'); ?>/keyword"><span class="glyphicon glyphicon-fire"></span> 內链关键词维护</a></dd>
<dd><a href="<?php echo route('admin'); ?>/friendlink"><span class="glyphicon glyphicon-leaf"></span> 友情链接</a></dd>
<dd><a href="<?php echo route('admin'); ?>/slide"><span class="glyphicon glyphicon-leaf"></span> 轮播图</a></dd>
<dd><a href="<?php echo route('admin'); ?>/user"><span class="glyphicon glyphicon-user"></span> 用户管理</a></dd>
<dd><a href="<?php echo route('admin'); ?>/article/repetarc"><span class="glyphicon glyphicon-cog"></span> 重复文档检测</a></dd>
<dt>系统设置</dt>
<dd><a href="<?php echo route('admin'); ?>/sysconfig"><span class="glyphicon glyphicon-wrench"></span> 系统基本参数</a></dd>
<dd><a href="<?php echo route('admin'); ?>/index/upcache"><span class="glyphicon glyphicon-refresh"></span> 更新缓存</a></dd>
<dd><a href="<?php echo route('admin'); ?>/guestbook"><span class="glyphicon glyphicon-wrench"></span> 在线留言</a></dd>
<dd><a href="<?php echo route('admin'); ?>/sysconfig" target="_blank"><span class="glyphicon glyphicon-book"></span> 参考文档</a></dd>
<dd><a href="<?php echo route('admin'); ?>/sysconfig" target="_blank"><span class="glyphicon glyphicon-envelope"></span> 意见反馈/官方交流</a></dd>
</dl>

18
resources/views/admin/index/index.blade.php

@ -0,0 +1,18 @@
<!DOCTYPE html><html><head><title><?php echo sysconfig('CMS_WEBNAME'); ?>后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h2 class="sub-header">LQYCMS管理中心</h2>
<p>· 欢迎使用专业的PHP网站管理系统,轻松建站的首选利器,完全免费、开源、无授权限制。<br>
· LQYCMS采用PHP+Mysql架构,符合企业网站SEO优化理念、功能全面、安全稳定。</p>
<h3>网站基本信息</h3>
域名/IP:<?php echo $_SERVER["SERVER_NAME"]; ?> | <?php echo $_SERVER["REMOTE_ADDR"]; ?><br>
运行环境:<?php echo @apache_get_version().' Mysql/'.@mysql_get_server_info(); ?>
<h3>开发人员</h3>
FLi、当代范蠡<br><br>
我们的联系方式:374861669@qq.com<br><br>
&copy; LQYCMS 版权所有
</div></div><!-- 右边结束 --></div></div>
</body></html>

47
resources/views/admin/index/jump.blade.php

@ -0,0 +1,47 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>跳转提示</title>
<style type="text/css">
*{ padding: 0; margin: 0; }
body{ background: #fff; font-family: '微软雅黑'; color: #333; font-size: 16px; }
.system-message{padding: 24px 48px;margin:5% auto 0 auto;width:600px;}
.system-message h1{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 12px; }
.system-message .jump{ padding-top: 10px}
.system-message .jump a{ color: #333;}
.system-message .success,.system-message .error{ line-height: 1.8em; font-size: 36px }
.system-message .detail{ font-size: 12px; line-height: 20px; margin-top: 12px; display:none}
</style>
</head><body>
<?php
/** 参数说明
* $_REQUEST['message']; //成功提示
* $_REQUEST['error']; //失败提示
* $_REQUEST['url']; //要跳转到哪里
* $_REQUEST['time']; //几秒后跳转
*/
?>
<div class="system-message">
<?php if(isset($_REQUEST['message'])) { ?>
<h1>:)</h1>
<p class="success"><?php echo $_REQUEST['message']; ?></p>
<?php }elseif(isset($_REQUEST['error'])){ ?>
<h1>:(</h1>
<p class="error"><?php echo $_REQUEST['error']; ?></p>
<?php } ?>
<p class="detail"></p>
<p class="jump">页面自动 <a id="href" href="<?php if(isset($_REQUEST['url'])){ echo $_REQUEST['url']; } ?>">跳转</a> 等待时间: <b id="wait"><?php if(isset($_REQUEST['time'])){ echo $_REQUEST['time']; } ?></b></p>
</div>
<script type="text/javascript">
(function(){
var wait = document.getElementById('wait'),href = document.getElementById('href').href;
var interval = setInterval(function(){
var time = --wait.innerHTML;
if(time <= 0)
{
location.href = href;
clearInterval(interval);
};
}, 1000);
})();
</script>
</body></html>

172
resources/views/admin/login/login.blade.php

@ -0,0 +1,172 @@
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1">
<title>后台登录</title>
<link rel="stylesheet" href="/css/bootstrap.min.css"><link rel="stylesheet" href="/css/admin.css"><script src="/js/jquery.min.js"></script><script src="/js/ad.js"></script></head><body>
<style>
body {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 16px;
color: #888;
line-height: 30px;
text-align: center;
background-color: #000;
}
.form-box {
margin-top: 35px;
}
.form-top {
overflow: hidden;
padding: 0 25px 15px 25px;
background: #fff;
-moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0;
text-align: left;
}
.form-top-left {
float: left;
width: 75%;
padding-top: 25px;
}
.form-top-left h3 { margin-top: 0;
font-size: 22px;
font-weight: 300;
color: #555;
line-height: 30px;}
.form-top-right {
float: left;
width: 25%;
padding-top: 5px;margin-top:15px;
font-size: 66px;
color: #ddd;
text-align: right;
}
.form-bottom {
padding: 25px 25px 30px 25px;
background: #eee;
-moz-border-radius: 0 0 4px 4px; -webkit-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;
text-align: left;
}
.form-bottom form textarea {
height: 100px;
}
.form-bottom form button.btn {
width: 100%;
}
.form-bottom form .input-error {
border-color: #4aaf51;
}
.social-login {
margin-top: 35px;
}
.social-login h3 {
color: #fff;
}
.social-login-buttons {
margin-top: 25px;
}
input[type="text"], input[type="password"], textarea, textarea.form-control {
height: 50px;
margin: 0;
padding: 0 20px;
vertical-align: middle;
background: #f8f8f8;
border: 3px solid #ddd;
font-family: 'Roboto', sans-serif;
font-size: 16px;
font-weight: 300;
line-height: 50px;
color: #888;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
-o-transition: all .3s;
-moz-transition: all .3s;
-webkit-transition: all .3s;
-ms-transition: all .3s;
transition: all .3s;
}
button.btn {
height: 50px;
margin: 0;
padding: 0 20px;
vertical-align: middle;
background: #4aaf51;
border: 0;
font-family: 'Roboto', sans-serif;
font-size: 16px;
font-weight: 300;
line-height: 50px;
color: #fff;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
text-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
-o-transition: all .3s;
-moz-transition: all .3s;
-webkit-transition: all .3s;
-ms-transition: all .3s;
transition: all .3s;
}
button.btn:hover { opacity: 0.6; color: #fff; }
</style>
<div class="container-fluid">
<div class="row">
<div class="col-sm-6 col-sm-offset-3 form-box">
<div class="form-top">
<div class="form-top-left">
<h3>后台登录</h3>
<p>请输入您的用户名、密码:</p>
</div>
<div class="form-top-right">
<i class="glyphicon glyphicon-user"></i>
</div>
</div>
<div class="form-bottom">
<form method="post" action="/fladmin/dologin" class="login-form" role="form">
{{ csrf_field() }}
<div class="form-group">
<label class="sr-only" for="form-username">Username</label>
<input type="text" id="username" name="username" placeholder="用户名/邮箱/手机号..." class="form-username form-control">
</div>
<div class="form-group">
<label class="sr-only" for="form-password">Password</label>
<input type="password" id="pwd" name="pwd" placeholder="输入密码..." class="form-password form-control">
</div>
<button type="submit" class="btn">立即登录</button>
</form>
</div>
</div>
</div>
</div>
<script>
$('.login-form input[type="text"], .login-form input[type="password"], .login-form textarea').on('focus', function() {
$(this).removeClass('input-error');
});
$('.login-form').on('submit', function(e) {
$(this).find('input[type="text"], input[type="password"], textarea').each(function(){
if( $(this).val() == "" ) {
e.preventDefault();
$(this).addClass('input-error');
}
else {
$(this).removeClass('input-error');
}
});
});
</script>
<script src="/js/bootstrap.min.js"></script></body></html>

160
resources/views/admin/page/add.blade.php

@ -0,0 +1,160 @@
<!DOCTYPE html><html><head><title>新建单页面_后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h5 class="sub-header"><a href="/fladmin/page">页面列表</a> > 新建页面</h5>
<form id="addarc" method="post" action="/fladmin/page/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">页面标题:</td>
<td><input name="title" type="text" id="title" value="" class="required" style="width:60%" placeholder="在此输入标题"></td>
</tr>
<tr>
<td align="right">别名:</td>
<td><input name="filename" type="text" id="filename" class="required" value="" size="30"> </td>
</tr>
<tr>
<td align="right">模板文件名:</td>
<td><input name="template" type="text" id="template" value="page" size="30"></td>
</tr>
<tr>
<td align="right">seoTitle:</td>
<td><input name="seotitle" type="text" id="seotitle" value="" style="width:60%"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">页面关键字:</td>
<td><input type="text" name="keywords" id="keywords" style="width:50%" value=""> (","分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">页面摘要信息:</td>
<td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"></textarea></td>
</tr>
<tr>
<td colspan="2"><strong>页面内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain"></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td>
</tr>
</tbody></table></form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
<script>
$(function(){
$(".required").blur(function(){
var $parent = $(this).parent();
$parent.find(".formtips").remove();
if(this.value=="")
{
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
}
else
{
if( $(this).is('#filename') ){
var reg = /^[a-zA-Z]+[0-9]*[a-zA-Z0-9]*$/;//验证是否为字母、数字
if(!reg.test($("#filename").val()))
{
$parent.append(' <small class="formtips onError"><font color="red">格式不正确!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
});
//重置
$('#addarc input[type="reset"]').click(function(){
$(".formtips").remove();
});
$("#addarc").submit(function(){
$(".required").trigger('blur');
var numError = $('#addarc .onError').length;
if(numError){return false;}
//$("#contents").val = ue.getContent();
//var datas = $('#addarc').serialize();//#form要在form里面
//var content = ue.getContent();
/* $.ajax({
url: "/fladmin/page/doadd",
type: "POST",
dataType: "json",
cache: false,
data: {
"template":$("#template").val(),
"filename":$("#filename").val(),
"litpic":$("#litpic").val(),
"title":$("#title").val(),
"seotitle":$("#seotitle").val(),
"keywords":$("#keywords").val(),
"description":$("#description").val(),
"content":content
//"title":title.replace("'", "&#039;"),
//"seotitle":seotitle.replace("'", "&#039;"),
//"keywords":keywords.replace("'", "&#039;"),
//"description":description.replace("'", "&#039;"),
//"contents":content.replace("'", "&#039;")
},
success: function(data){
if(data.code==200)
{
//alert(data.info);
window.location.replace("/fladmin/page");
}
}
}); */
});
});
</script>
</body></html>

156
resources/views/admin/page/edit.blade.php

@ -0,0 +1,156 @@
<!DOCTYPE html><html><head><title>修改单页面_后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h5 class="sub-header"><a href="/fladmin/page">页面列表</a> > 新建页面</h5>
<form id="addarc" method="post" action="/fladmin/page/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">页面标题:</td>
<td><input name="title" type="text" id="title" value="<?php echo $post["title"]; ?>" class="required" style="width:60%" placeholder="在此输入标题"> <input style="display:none;" type="text" name="id" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td align="right">别名:</td>
<td><input name="filename" type="text" id="filename" class="required" value="<?php echo $post["filename"]; ?>" size="30"> </td>
</tr>
<tr>
<td align="right">模板文件名:</td>
<td><input name="template" type="text" id="template" value="<?php echo $post["template"]; ?>" size="30"></td>
</tr>
<tr>
<td align="right">seoTitle:</td>
<td><input name="seotitle" type="text" id="seotitle" value="<?php echo $post["seotitle"]; ?>" style="width:60%"></td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">缩略图:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="<?php echo $post["litpic"]; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["litpic"]) || !imgmatch($post["litpic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["litpic"])){echo $post["litpic"];} ?>" width="120" height="80" id="picview" name="picview"></td>
</tr>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#litpic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td align="right">页面关键字:</td>
<td><input type="text" name="keywords" id="keywords" style="width:50%" value="<?php echo $post["keywords"]; ?>"> (","分开)</td>
</tr>
<tr>
<td align="right" style="vertical-align:middle;">页面摘要信息:</td>
<td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"><?php echo $post["description"]; ?></textarea></td>
</tr>
<tr>
<td colspan="2"><strong>页面内容:</strong></td>
</tr>
<tr>
<td colspan="2">
<!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain"><?php echo $post["body"]; ?></script>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td>
</tr>
</tbody></table></form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
<script>
$(function(){
$(".required").blur(function(){
var $parent = $(this).parent();
$parent.find(".formtips").remove();
if(this.value=="")
{
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
}
else
{
if( $(this).is('#filename') ){
var reg = /^[a-zA-Z]+[0-9]*[a-zA-Z0-9]*$/;//验证是否为字母、数字
if(!reg.test($("#filename").val()))
{
$parent.append(' <small class="formtips onError"><font color="red">格式不正确!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
}
});
//重置
$('#addarc input[type="reset"]').click(function(){
$(".formtips").remove();
});
$("#addarc").submit(function(){
$(".required").trigger('blur');
var numError = $('#addarc .onError').length;
if(numError){return false;}
//$("#contents").val = ue.getContent();
//var datas = $('#addarc').serialize();//#form要在form里面
//var content = ue.getContent();
/* $.ajax({
url: "/fladmin/page/doedit",
type: "POST",
cache: false,
dataType: "json",
data: {
"id":$("#id").val(),
"template":$("#template").val(),
"filename":$("#filename").val(),
"litpic":$("#litpic").val(),
"title":$("#title").val(),
"seotitle":$("#seotitle").val(),
"keywords":$("#keywords").val(),
"description":$("#description").val(),
"content":content
},
success: function(data){
if(data.code==200)
{
//alert(data.info);
window.location.replace("/fladmin/page");
}
}
}); */
});
});
</script>
</body></html>

33
resources/views/admin/page/index.blade.php

@ -0,0 +1,33 @@
<!DOCTYPE html><html><head><title>单页面列表_后台管理</title>@include('admin.common.header')
<div class="container-fluid">
<div class="row">
<!-- 左边开始 --><div class="col-sm-3 col-md-2 sidebar">@include('admin.common.leftmenu')</div><!-- 左边结束 -->
<!-- 右边开始 --><div class="col-sm-9 col-md-10 rightbox"><div id="mainbox">
<h2 class="sub-header">单页文档管理</h2>[ <a href="/fladmin/page/add">增加一个页面</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-striped table-hover">
<thead>
<tr>
<th>编号</th>
<th>页面名称</th>
<th>别名</th>
<th>更新时间</th>
<th>管理</th>
</tr>
</thead>
<tbody>
<?php if($posts){foreach($posts as $row){ ?>
<tr>
<td><?php echo $row["id"]; ?></td>
<td><a href="/fladmin/page/edit?id=<?php echo $row["id"]; ?>"><?php echo $row["title"]; ?></a></td>
<td><?php echo $row["filename"]; ?></td>
<td><?php echo date('Y-m-d',$row["pubdate"]); ?></td>
<td><a target="_blank" href="<?php echo get_front_url(array("type"=>"page","pagename"=>$row["filename"])); ?>">预览</a>&nbsp;<a href="/fladmin/page/edit?id=<?php echo $row["id"]; ?>">修改</a>&nbsp;<a onclick="delconfirm('/fladmin/page/del?id=<?php echo $row["id"]; ?>')" href="javascript:;">删除</a></td>
</tr>
<?php }} ?>
</tbody>
</table></div><!-- 表格结束 --></form><!-- 表单结束 -->
</div></div><!-- 右边结束 --></div></div>
</body></html>

20
resources/views/home/404.blade.php

@ -0,0 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>您访问的页面不存在或已被删除!</title>
<style type="text/css">
*{padding:0;margin:0;}
body{background:#fff;font-family:'微软雅黑';color:#333;font-size:16px;}
.system-message{padding:24px 48px;margin:5% auto 0 auto;width:600px;}
.system-message h1{font-size:100px;font-weight:normal;line-height:120px;margin-bottom:12px;}
.system-message .jump{padding-top:10px}
.system-message .jump a{color:#333;}
.system-message .success,.system-message .error{line-height:1.8em;font-size:36px}
.system-message .detail{font-size:14px;line-height:20px;margin-top:12px;}
</style>
</head><body>
<div class="system-message">
<h1>:(</h1>
<p class="error">您访问的页面不存在或已被删除!</p>
<p class="detail"><a href="<?php echo route('home');?>">返回首页</a></p>
</div>
</body></html>

63
routes/web.php

@ -13,7 +13,7 @@
//wap路由,要放到最前面,否则解析不到 //wap路由,要放到最前面,否则解析不到
Route::group(['domain' => env('APP_SUBDOMAIN'), 'namespace' => 'Wap'], function () { Route::group(['domain' => env('APP_SUBDOMAIN'), 'namespace' => 'Wap'], function () {
Route::get('/', 'IndexController@index');
Route::get('/', 'IndexController@index')->name('wap_home');
Route::get('/tags', 'IndexController@tags'); Route::get('/tags', 'IndexController@tags');
Route::get('/search', 'IndexController@search'); Route::get('/search', 'IndexController@search');
Route::get('/cat{cat}/id{id}', 'IndexController@detail'); //详情页 Route::get('/cat{cat}/id{id}', 'IndexController@detail'); //详情页
@ -21,7 +21,7 @@ Route::group(['domain' => env('APP_SUBDOMAIN'), 'namespace' => 'Wap'], function
Route::get('/cat{cat}', 'IndexController@category'); //分类页 Route::get('/cat{cat}', 'IndexController@category'); //分类页
Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页 Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页
Route::get('/tag{tag}', 'IndexController@tag'); //标签页 Route::get('/tag{tag}', 'IndexController@tag'); //标签页
Route::get('/{id}', 'IndexController@page'); //单页
Route::get('/page/{id}', 'IndexController@singlepage')->name('wap_singlepage'); //单页
Route::get('/aaa', function () { Route::get('/aaa', function () {
dd('wap'); dd('wap');
}); });
@ -30,15 +30,16 @@ Route::group(['domain' => env('APP_SUBDOMAIN'), 'namespace' => 'Wap'], function
//前台路由 //前台路由
Route::group(['namespace' => 'Home'], function () { Route::group(['namespace' => 'Home'], function () {
Route::get('/', 'IndexController@index');
Route::get('/tags', 'IndexController@tags');
Route::get('/', 'IndexController@index')->name('home');
Route::get('/page404', 'IndexController@page404')->name('page404'); //404页面
Route::get('/tags', 'IndexController@tags')->name('tags');
Route::get('/search', 'IndexController@search'); Route::get('/search', 'IndexController@search');
Route::get('/cat{cat}/id{id}', 'IndexController@detail'); //详情页 Route::get('/cat{cat}/id{id}', 'IndexController@detail'); //详情页
Route::get('/cat{cat}/{page}', 'IndexController@category'); //分类页,分页 Route::get('/cat{cat}/{page}', 'IndexController@category'); //分类页,分页
Route::get('/cat{cat}', 'IndexController@category'); //分类页 Route::get('/cat{cat}', 'IndexController@category'); //分类页
Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页 Route::get('/tag{tag}/{page}', 'IndexController@tag'); //标签页,分页
Route::get('/tag{tag}', 'IndexController@tag'); //标签页 Route::get('/tag{tag}', 'IndexController@tag'); //标签页
Route::get('/{id}', 'IndexController@page'); //单页
Route::get('/page/{id}', 'IndexController@page')->name('page'); //单页
Route::get('/aaa', function () { Route::get('/aaa', function () {
dd('wap'); dd('wap');
@ -47,12 +48,56 @@ Route::group(['namespace' => 'Home'], function () {
//后台路由 //后台路由
Route::group(['prefix' => 'Admin'], function () {
Route::get('/bbb', function () {
// 匹配 "/fladmin/users" URL
});
Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['web']], function () {
Route::get('/', 'IndexController@index')->name('admin');
//文章
Route::get('/article', 'ArticleController@index')->name('admin_article');
Route::get('/article/add', 'ArticleController@add')->name('admin_article_add');
Route::post('/article/doadd', 'ArticleController@doadd')->name('admin_article_doadd');
Route::get('/article/edit', 'ArticleController@edit')->name('admin_article_edit');
Route::post('/article/doedit', 'ArticleController@doedit')->name('admin_article_doedit');
Route::get('/article/del', 'ArticleController@del')->name('admin_article_del');
Route::get('/article/repetarc', 'ArticleController@repetarc')->name('admin_article_repetarc');
Route::get('/article/recommendarc', 'ArticleController@recommendarc')->name('admin_article_recommendarc');
Route::get('/article/articleexists', 'ArticleController@articleexists')->name('admin_article_articleexists');
//栏目
Route::get('/category', 'CategoryController@index')->name('admin_category');
Route::get('/category/add', 'CategoryController@add')->name('admin_category_add');
Route::post('/category/doadd', 'CategoryController@doadd')->name('admin_category_doadd');
Route::get('/category/edit', 'CategoryController@edit')->name('admin_category_edit');
Route::post('/category/doedit', 'CategoryController@doedit')->name('admin_category_doedit');
Route::get('/category/del', 'CategoryController@del')->name('admin_category_del');
//单页
Route::get('/page', 'PageController@index')->name('admin_page');
Route::get('/page/add', 'PageController@add')->name('admin_page_add');
Route::post('/page/doadd', 'PageController@doadd')->name('admin_page_doadd');
Route::get('/page/edit', 'PageController@edit')->name('admin_page_edit');
Route::post('/page/doedit', 'PageController@doedit')->name('admin_page_doedit');
Route::get('/page/del', 'PageController@del')->name('admin_page_del');
Route::get('/friendlink', 'FriendlinkController@index')->name('admin_friendlink');
Route::get('/guestbook', 'GuestbookController@index')->name('admin_guestbook');
Route::get('/keyword', 'KeywordController@index')->name('admin_keyword');
Route::get('/product', 'ProductController@index')->name('admin_product');
Route::get('/search', 'SearchController@index')->name('admin_search');
Route::get('/slide', 'SlideController@index')->name('admin_slide');
Route::get('/tag', 'TagController@index')->name('admin_tag');
Route::get('/sysconfig', 'SysconfigController@index')->name('admin_sysconfig');
//后台登录注销
Route::get('/login', 'LoginController@login')->name('admin_login');
Route::post('/dologin', 'LoginController@dologin');
Route::get('/logout', 'LoginController@logout')->name('admin_logout');
Route::get('/recoverpwd', 'LoginController@recoverpwd')->name('admin_recoverpwd');
}); });
Route::get('/fladmin/jump', 'Admin\IndexController@jump')->name('admin_jump');
//Route::get('/fladmin', 'Admin\IndexController@index')->name('admin');
//Route::get('/fladmin/login', 'Admin\LoginController@login')->name('admin_login');
//Route::post('/fladmin/dologin', 'Admin\LoginController@dologin');
//Route::get('/fladmin/logout', 'Admin\LoginController@logout');
//接口路由 //接口路由
Route::group(['prefix' => 'Api'], function () { Route::group(['prefix' => 'Api'], function () {

Loading…
Cancel
Save