From 7eb272c43714817f4b05408678fbabee8cc5a18e Mon Sep 17 00:00:00 2001 From: tao Date: Tue, 2 Aug 2022 18:46:05 +0800 Subject: [PATCH] 1.9.3 --- README.md | 23 +- addons/gitee - 快捷方式.lnk | Bin 687 -> 0 bytes app/admin/controller/Index.php | 6 +- app/admin/controller/Seo.php | 85 +++--- app/admin/controller/Set.php | 229 ++++++++++++---- app/admin/model/PushJscode.php | 63 +++++ app/admin/route/route.php | 6 +- app/admin/view/index/home.html | 6 +- app/admin/view/public/base.html | 11 +- app/admin/view/public/footer.html | 11 +- app/admin/view/seo/index.html | 104 ++++++- app/admin/view/set/system/website.html | 217 +++++++++------ app/common/controller/AdminController.php | 43 +++ app/common/lib/SetArr.php | 287 +++++++++----------- app/index/controller/Article.php | 8 +- app/index/controller/Comment.php | 3 + app/index/controller/Login.php | 6 +- app/index/route/route.php | 13 +- app/middleware/Auth.php | 13 +- config/app.php | 15 +- config/taoler.php | 15 +- vendor/composer/installed.php | 4 +- vendor/services.php | 2 +- vendor/taoser/think-setarr/src/SetArr.php | 7 +- view/taoler/index/article/ask/detail.html | 17 +- view/taoler/index/article/news/detail.html | 72 ++--- view/taoler/index/article/posts/detail.html | 18 +- view/taoler/index/login/forget.html | 2 +- view/taoler/index/public/column.html | 2 +- view/taoler/index/public/menu.html | 2 +- view/taoler/index/user/message.html | 15 +- 31 files changed, 815 insertions(+), 490 deletions(-) delete mode 100644 addons/gitee - 快捷方式.lnk create mode 100644 app/admin/model/PushJscode.php diff --git a/README.md b/README.md index da62046..255aa30 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ > TaoLer是一个简单迅捷的轻论坛系统,适用于个人或组织区域型信息交流发布平台。 * 官网:https://www.aieok.com - * 版本:TaoLer 1.9.2 - * 日期:2022.4.19 + * 版本:TaoLer 1.9.3 + * 日期:2022.4.22 webman版新架构已适配90% @@ -99,21 +99,16 @@ #### 前后台独立域名的绑定 -1. 手动修改`config/app.php`文件内的`'domain_bind'`对应的应用。 - ```html - // 域名绑定(自动多应用模式有效) - 'domain_bind' => [ - 'bbs' => 'index', //bbs.xxx.com 访问的是Index应用 - 'adm' => 'admin', //adm.xxx.com 访问的是Admin应用 - 'api' => 'api' //api.xxx.com 访问的是Admin应用 - 'www.test.com' => 'test' //www.test.com 访问的是Test应用 - ], - ``` - -2. 后面会针对动态的设置绑定域名功能开发...此处待完成 +1. 支持设置绑定域名 > 如果绑定`index`应用对应的域名,后台`admin`应用也必须独立绑定域名,否则原`xxx.com/admin`访问路径就无法再访问。 +2. 支持应用设置映射 + +> 域名绑定的优先级高于应用映射,若绑定过域名,直接访问域名,如果没有绑定过域名,访问路径为xxx.com/youbind. +如后台的映射地址 www.xxx.com/youadmin + + #### 使用说明 diff --git a/addons/gitee - 快捷方式.lnk b/addons/gitee - 快捷方式.lnk deleted file mode 100644 index 722009e71eb4e2dd7dd2d57d6aac021d84104e2f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 687 zcmeZaU|?VrVFHp23PX*>C%%e+n_0?EFS>hm^p!1r~DPfIQC+l5_wOM|Xgu6=V&_bhtI`so(r8BOyV> z2a<3AVtAwj*`SyJ*}W_)S;KbfCBd!N7!LT~l(?V@6qf^Hut`9lK^=_j0+1{NgC!7y y4A>}^>$0}Dz+<_GgWeL`iXM>TGe8PFfH;lYw$v){ - $url = (string) str_replace("admin","index",$this->domain.url('article/detail',['id'=>$v['aid']])); + //$url = (string) str_replace("admin","index",$this->domain.url('article/detail',['id'=>$v['aid']])); + $url = $this->getRouteUrl($v['aid']); $res['data'][]= ['id'=>$url,'title'=>htmlspecialchars($v['title']),'name'=>$v['name'],'catename'=>$v['catename'],'pv'=>$v['pv']]; } } else { @@ -152,7 +153,7 @@ class Index extends AdminController if ($count) { $res = ['code'=>0,'msg'=>'','count'=>$count]; foreach($replys as $k => $v){ - $res['data'][] = ['content'=>htmlspecialchars($v['content']),'title'=>htmlspecialchars($v['title']),'cid'=>str_replace("admin","index",$this->domain.(string) url('article/detail',['id'=>$v['cid']])),'name'=>$v['name']]; + $res['data'][] = ['content'=>htmlspecialchars($v['content']),'title'=>htmlspecialchars($v['title']),'cid'=>$this->getRouteUrl($v['cid']),'name'=>$v['name']]; } } else { $res = ['code'=>-1,'msg'=>'本周还没评论']; @@ -183,7 +184,6 @@ class Index extends AdminController //$mail = Db::name('system')->where('id',1)->value('auth_mail'); // bug邮件发送 if(Request::isAjax()){ $data = Request::only(['type','title','content','post']); - //halt($data); $apiRes = Api::urlPost($url,$data); $data['poster'] = Session::get('admin_id'); unset($data['post']); diff --git a/app/admin/controller/Seo.php b/app/admin/controller/Seo.php index 84e9dd1..eb42742 100644 --- a/app/admin/controller/Seo.php +++ b/app/admin/controller/Seo.php @@ -2,7 +2,7 @@ /* * @Author: TaoLer * @Date: 2022-04-13 09:54:31 - * @LastEditTime: 2022-04-19 16:42:47 + * @LastEditTime: 2022-04-21 11:39:38 * @LastEditors: TaoLer * @Description: 搜索引擎SEO优化设置 * @FilePath: \TaoLer\app\admin\controller\Seo.php @@ -16,19 +16,30 @@ use think\facade\View; use think\facade\Request; use think\facade\Db; use taoser\SetArr; +use app\admin\model\PushJscode; class Seo extends AdminController { public function index() { + // 站点地图 + $xml = ''; + $xmlArr = $this->getXmlFile(public_path()); + foreach($xmlArr as $v) { + $map = $this->getIndexUrl().'/'.$v; + $xml .= $map."\n"; + } + // robots if(is_file($rob = public_path().'robots.txt')){ $robots = file_get_contents($rob); } else { $robots = ''; - } - - View::assign('robots',$robots); + } + // push_js + $pushjs = new PushJscode(); + $jscode = $pushjs->getAllCodes(); + View::assign(['xml'=>$xml,'jscode'=>$jscode,'robots'=>$robots]); return View::fetch(); } @@ -161,7 +172,6 @@ class Seo extends AdminController $str .= << $url - $time daily 0.5 @@ -258,46 +268,41 @@ class Seo extends AdminController } /** - * 获取文章链接地址 + * 保存搜索平台js代码 * - * @param integer $aid - * @return string + * @return void */ - protected function getRouteUrl(int $aid) : string + public function savePushJs() { - $indexUrl = $this->getIndexUrl(); - $artUrl = (string) url('detail_id', ['id' => $aid]); - - // 判断是否开启绑定 - //$domain_bind = array_key_exists('domain_bind',config('app')); - - // 判断index应用是否绑定域名 - $bind_index = array_search('index',config('app.domain_bind')); - // 判断admin应用是否绑定域名 - $bind_admin = array_search('admin',config('app.domain_bind')); - - // 判断index应用是否域名映射 - $map_index = array_search('index',config('app.app_map')); - // 判断admin应用是否域名映射 - $map_admin = array_search('admin',config('app.app_map')); - - $index = $map_index ? $map_index : 'index'; // index应用名 - $admin = $map_admin ? $map_admin : 'admin'; // admin应用名 - - if($bind_index) { - // index绑定域名 - $url = $indexUrl . str_replace($admin.'/','',$artUrl); - } else { // index未绑定域名 - // admin绑定域名 - if($bind_admin) { - $url = $indexUrl .'/' . $index . $artUrl; - } else { - $url = $indexUrl . str_replace($admin,$index,$artUrl); - } - + $data = Request::only(['name','jscode']); + if(empty($data['name'])) { + return json(['code'=>-1,'msg'=>'请术输入名称']); } + if(empty($data['jscode'])){ + return json(['code'=>-1,'msg'=>'请术输入代码']); + } + $push = new PushJscode(); + $res = $push->saveCode($data); + if(!$res) { + return json(['code'=>-1,'msg'=>'保存失败']); + } + return json(['code'=>0,'msg'=>'保存成功']); + } - return $url; + /** + * 删除平台js代码 + * + * @return void + */ + public function delPushJs() + { + $id = (int) input('id'); + $push = new PushJscode(); + $res = $push->delCode($id); + if(!$res) { + return json(['code'=>-1,'msg'=>'删除失败']); + } + return json(['code'=>0,'msg'=>'删除成功']); } } \ No newline at end of file diff --git a/app/admin/controller/Set.php b/app/admin/controller/Set.php index 6347208..93ebf3b 100644 --- a/app/admin/controller/Set.php +++ b/app/admin/controller/Set.php @@ -2,7 +2,7 @@ /* * @Author: TaoLer * @Date: 2021-12-06 16:04:50 - * @LastEditTime: 2022-04-19 14:06:54 + * @LastEditTime: 2022-04-22 06:30:01 * @LastEditors: TaoLer * @Description: 搜索引擎SEO优化设置 * @FilePath: \TaoLer\app\admin\controller\Set.php @@ -22,6 +22,7 @@ use taoler\com\Files; use think\facade\Session; use think\facade\Cookie; use taoser\SetArr; +use app\common\lib\SetArr as SetArrConf; class Set extends AdminController { @@ -30,13 +31,22 @@ class Set extends AdminController parent::initialize(); $this->sysInfo = $this->getSystem(); } + //网站设置显示 public function index() { $mailserver = MailServer::find(1); $template = Files::getDirName('../view'); $email = Db::name('admin')->where('id',1)->value('email'); - View::assign(['sysInfo'=>$this->sysInfo,'mailserver'=>$mailserver,'template'=>$template,'email'=>$email]); + + // 应用映射 + $index_map = array_search('index',config('app.app_map')); + $admin_map = array_search('admin',config('app.app_map')); + $index_map = $index_map ? $index_map : ''; + $admin_map = $admin_map ? $admin_map : ''; + View::assign(['sysInfo'=>$this->sysInfo,'mailserver'=>$mailserver,'template'=>$template,'email'=>$email,'index_map'=>$index_map,'admin_map'=>$admin_map]); + + // 域名绑定 if(!empty(config('app.domain_bind'))){ $data = array_flip(config('app.domain_bind')); $domain_bind = [ @@ -50,6 +60,20 @@ class Set extends AdminController ]; } View::assign($domain_bind); + + // url美化 + $urlArr = config('taoler.url_rewrite'); + $urlRe = []; + foreach($urlArr as $k => $v) { + if(!empty($v)) { + $urlRe[$k] = substr($v, 0, strrpos($v, '/')); + } else { + $urlRe[$k] = ''; + } + } + + View::assign('url_re',$urlRe); + return View::fetch('set/system/website'); } @@ -67,44 +91,6 @@ class Set extends AdminController } } } - - // 域名绑定 - public function setDomain() - { - if(Request::isPost()){ - //$data = Request::only(['index','admin']); - $data = Request::param(); - //dump($data); - if($data['domain_check'] == 'on') { - unset($data['domain_check']); - $data = array_flip($data); - if(empty(config('app.domain_bind'))){ - // 写入token - $res = SetArr::name('app')->add([ - 'domain_bind'=> $data, - ]); - }else{ - // 编辑 - $res = SetArr::name('app')->edit([ - 'domain_bind'=> $data, - ]); - } - //清空缓存 - Cookie::delete('adminAuth'); - Session::clear(); - } else { - $res = SetArr::name('app')->delete([ - 'domain_bind'=> config('app.domain_bind'), - ]); - } - if($res == true){ - return json(['code'=>0,'msg'=>'成功']); - } else{ - return json(['code'=>-1,'msg'=>'失败']); - } - } - - } //综合设置 public function server() @@ -130,8 +116,13 @@ class Set extends AdminController } } - public function sendMailCode() - { + /** + * 发验证码 + * + * @return void + */ + public function sendMailCode() + { if(Request::isPost()){ $email = Request::param('email'); $code = mt_rand('1111','9999'); @@ -146,8 +137,13 @@ class Set extends AdminController return json($res); } - public function activeMailServer() - { + /** + * 邮件激活 + * + * @return void + */ + public function activeMailServer() + { if(Request::isPost()){ $eCode = Request::param('code'); $sCode = Cache::get('test_code'); @@ -199,13 +195,150 @@ class Set extends AdminController } } + // 域名绑定 + public function setDomain() + { + $str = file_get_contents(str_replace('\\', '/', app()->getConfigPath() . 'app.php')); + if(Request::isPost()){ + $data = Request::only(['index','admin','domain_check']); + //$data = Request::param(); + //dump($data); + if($data['domain_check'] == 'on') { + + // 过滤空项目 + $domain_bind = []; + if(!empty($data['index'])){ + $domain_bind[$data['index']] ='index'; + if(config('app.default_app') == $domain_bind[$data['index']]) { + if(empty($data['admin'])) { + return json(['code'=>-1, 'msg'=>'默认应用和Index一致时必须绑定Admin域名,否则无法进入后台']); + } + } + } + if(!empty($data['admin'])){ + $domain_bind[$data['admin']] ='admin'; + } + + + // 匹配整个domain_map数组 + $pats_domain_bind = '/\'(domain_bind)\'[^\]]*\],/'; + // 空数组 + $rep_domain_null = "'domain_bind'\t=> [\n\t],"; + $str = preg_replace($pats_domain_bind, $rep_domain_null, $str); + + // 匹配'domain_bind' => [ + $pats = '/\'(domain_bind)\'\s*=>\s*\[\r?\n/'; + preg_match($pats,$str,$arr); + + // 拼接数组内字符串 + $domainArr = ''; + foreach($domain_bind as $k => $v){ + $domainArr .= "\t\t'". $k. "' => '" . $v . "',\n"; + } + + // 追加组成新数组写入文件 + $reps = $arr[0].$domainArr; + $str = preg_replace($pats, $reps, $str); + + $res = file_put_contents(app()->getConfigPath() . 'app.php', $str); + + // 如果编辑了后台 ,需要清理退出缓存 + if(!empty($domain_bind[$data['admin']])) { + //清空缓存 + Cookie::delete('adminAuth'); + Session::clear(); + } + } else { + $res = SetArr::name('app')->delete([ + 'domain_bind'=> config('app.domain_bind'), + ]); + } + + if($res == true){ + return json(['code'=>0,'msg'=>'成功']); + } else{ + return json(['code'=>-1,'msg'=>'失败']); + } + } + + } + + /** + * 绑定应用映射 + * + * @return void + */ + public function bindMap() + { + $data = Request::only(['index_map','admin_map']); + $str = file_get_contents(str_replace('\\', '/', app()->getConfigPath() . 'app.php')); + + // 过滤空项目 + $app_map = []; + if(!empty($data['index_map'])){ + $app_map[$data['index_map']]='index'; + } + if(!empty($data['admin_map'])){ + $app_map[$data['admin_map']] ='admin'; + } + + //halt($app_map); + // $set = new SetArrConf('app'); + // $res = $set->delete(['app_map' => config('app.app_map')])->add([ + // 'app_map' => $app_map, + // ])->put(); + + // halt($res); + + // 匹配整个app_map数组 + $pats_app_map = '/\'(app_map)\'[^\]]*\],/'; + preg_match($pats_app_map,$str,$arr_map); + + // 空数组 + $rep_map_null = "'app_map'\t=> [\n\t],"; + $str = preg_replace($pats_app_map, $rep_map_null, $str); + + // 匹配'app_map' => [ + $pats = '/\'(app_map)\'\s*=>\s*\[\r?\n/'; + preg_match($pats,$str,$arr); + + // 拼接数组内字符串 + $appArr = ''; + foreach($app_map as $k => $v){ + $appArr .= "\t\t'". $k. "' => '" . $v . "',\n"; + } + + // 追加组成新数组写入文件 + $reps = $arr[0].$appArr; + $str = preg_replace($pats, $reps, $str); + + $res = file_put_contents(app()->getConfigPath() . 'app.php', $str); + + if(!$res) { + return json(['code'=>-1,'msg'=>'绑定失败']); + } + return json(['code'=>0,'msg'=>'绑定成功']); + + } + + /** + * URL美化,设置访问链接 + * + * @return void + */ public function setUrl() { - // $data = Request::only(['article_as','cate_as']); - $arr = [ - 'url_rewrite'=>$data, - ]; + $arr = []; + foreach($data as $k => $v) { + if(!empty($v)) { + $arr['url_rewrite'][$k] = $v . '/'; + } else { + $arr['url_rewrite'][$k] = ''; + } + } + if(empty($arr['url_rewrite']['cate_as'])) return json(['code'=>-1,'msg'=>'分类不能为空']); + if(!array_key_exists('url_rewrite',config('taoler'))){ $result = SetArr::name('taoler')->add($arr); } else { diff --git a/app/admin/model/PushJscode.php b/app/admin/model/PushJscode.php new file mode 100644 index 0000000..7f2c825 --- /dev/null +++ b/app/admin/model/PushJscode.php @@ -0,0 +1,63 @@ + + * @Date: 2022-04-20 10:45:41 + * @LastEditTime: 2022-04-20 12:34:40 + * @LastEditors: TaoLer + * @Description: 搜索引擎SEO优化设置 + * @FilePath: \TaoLer\app\admin\model\PushJscode.php + * Copyright (c) 2020~2022 http://www.aieok.com All rights reserved. + */ + +namespace app\admin\model; + +use think\Model; + +class PushJscode extends Model +{ + /** + * 保存代码 + * + * @param [type] $data + * @return void + */ + public function saveCode($data) + { + $res = $this->save($data); + if($res == true) { + return true; + } else { + return false; + } + } + + /** + * 获取所有数据 + * + * @return void + */ + public function getAllCodes() + { + // + return $this->select(); + } + + /** + * 删除数据 + * + * @param [type] $id + * @return void + */ + public function delCode($id) + { + // + $res = $this::destroy($id); + + if($res == true) { + return true; + } else { + return false; + } + } + +} \ No newline at end of file diff --git a/app/admin/route/route.php b/app/admin/route/route.php index fea4895..57ee5d1 100644 --- a/app/admin/route/route.php +++ b/app/admin/route/route.php @@ -2,7 +2,7 @@ /* * @Author: TaoLer * @Date: 2021-12-06 16:04:50 - * @LastEditTime: 2022-04-19 14:31:41 + * @LastEditTime: 2022-04-21 17:02:15 * @LastEditors: TaoLer * @Description: 搜索引擎SEO优化设置 * @FilePath: \TaoLer\app\admin\route\route.php @@ -11,8 +11,8 @@ use think\facade\Route; -//详情页URL别称 +// 动态详情页URL别称 $detail_as = config('taoler.url_rewrite.article_as'); Route::get('captcha/[:config]','\\think\\captcha\\CaptchaController@index'); -Route::get($detail_as.'/:id', '\app\index\controller\Article::detail')->name('detail_id'); +Route::get(config('taoler.url_rewrite.article_as').'', '\app\index\controller\Article@detail')->name('detail_id'); diff --git a/app/admin/view/index/home.html b/app/admin/view/index/home.html index bf3607a..a8045d5 100644 --- a/app/admin/view/index/home.html +++ b/app/admin/view/index/home.html @@ -85,13 +85,13 @@
  • - +

    待审评论

    {$comms}

  • - +

    待审帖子

    {$forums}

    @@ -226,7 +226,7 @@ diff --git a/app/admin/view/public/base.html b/app/admin/view/public/base.html index c7d7d0c..0193ac9 100644 --- a/app/admin/view/public/base.html +++ b/app/admin/view/public/base.html @@ -1,3 +1,12 @@ + @@ -10,7 +19,7 @@ {block name="css"}{/block} - + {block name="body"}内容{/block} diff --git a/app/admin/view/public/footer.html b/app/admin/view/public/footer.html index bbd0d18..b3f5957 100644 --- a/app/admin/view/public/footer.html +++ b/app/admin/view/public/footer.html @@ -1,5 +1,14 @@ + \ No newline at end of file diff --git a/app/admin/view/seo/index.html b/app/admin/view/seo/index.html index 5c1195f..e3122de 100644 --- a/app/admin/view/seo/index.html +++ b/app/admin/view/seo/index.html @@ -12,6 +12,7 @@
  • 百度推送
  • 站点地图
  • robots
  • +
  • 自动提交
@@ -97,6 +98,12 @@
+
+
+
+ +
+
@@ -105,7 +112,7 @@
- +
会自动写入sitemap的链接
@@ -115,6 +122,47 @@ + +
+
+
+ +
+ +
+
js自动收录平台
+
+
+ +
+ +
+
+
+
+ +
+
+
+ + {volist name="jscode" id="vo"} +
+
+
+ +
+ +
+
+
+
+ + +
+
+
+ {/volist} +
@@ -145,10 +193,11 @@ var field = data.field; $.post("{:url('seo/push')}",field,function(res){ if(res.code == 0){ - layer.msg(res.msg,{icon:6,tiye:2000 - }); + layer.msg(res.msg,{icon:6,tiye:2000},function(){ + location.reload(); + }); } else { - layer.open({title:"设置失败",content:res.msg,icon:5,anim:6}); + layer.open({title:"推送失败",content:res.msg,icon:5,anim:6}); } }); return false; @@ -159,10 +208,11 @@ var field = data.field; $.post("{:url('seo/config')}",field,function(res){ if(res.code == 0){ - layer.msg(res.msg,{icon:6,tiye:2000 + layer.msg(res.msg,{icon:6,tiye:2000},function(){ + location.reload(); }); } else { - layer.open({title:"设置失败",content:res.msg,icon:5,anim:6}); + layer.open({title:"配置失败",content:res.msg,icon:5,anim:6}); } }); return false; @@ -173,21 +223,23 @@ var field = data.field; $.post("{:url('seo/map')}",field,function(res){ if(res.code == 0){ - layer.msg(res.msg,{icon:6,tiye:2000 + layer.msg(res.msg,{icon:6,tiye:2000},function(){ + location.reload(); }); } else { - layer.open({title:"设置失败",content:res.msg,icon:5,anim:6}); + layer.open({title:"生成失败",content:res.msg,icon:5,anim:6}); } }); return false; }); - // map + // robots form.on('submit(robots_submit)', function(data){ var field = data.field; $.post("{:url('seo/robots')}",field,function(res){ if(res.code == 0){ - layer.msg(res.msg,{icon:6,tiye:2000 + layer.msg(res.msg,{icon:6,tiye:2000},function(){ + location.reload(); }); } else { layer.open({title:"设置失败",content:res.msg,icon:5,anim:6}); @@ -196,12 +248,40 @@ return false; }); + // 添加自动提交JS代码 + form.on('submit(push_jscode_submit)', function(data){ + var field = data.field; + $.post("{:url('seo/savePushJs')}",field,function(res){ + if(res.code == 0){ + layer.msg(res.msg,{icon:6,tiye:2000},function(){ + location.reload(); + }); + } else { + layer.open({title:"添加失败",content:res.msg,icon:5,anim:6}); + } + }); + return false; + }); + + // 删除自动提交JS代码 + form.on('submit(push_jscode_del)', function(data){ + var field = data.field; + $.post("{:url('seo/delPushJs')}",field,function(res){ + if(res.code == 0){ + layer.msg(res.msg,{icon:6,tiye:2000},function(){ + location.reload(); + }); + } else { + layer.open({title:"删除失败",content:res.msg,icon:5,anim:6}); + } + }); + return false; + }); - //显示当前tab + // 显示当前tab if(location.hash){ element.tabChange('seo-tabs-brief', location.hash.replace(/^#/, '')); } - element.on('tab(seo-tabs-brief)', function(){ var othis = $(this), layid = othis.attr('lay-id'); if(layid){ diff --git a/app/admin/view/set/system/website.html b/app/admin/view/set/system/website.html index f17cf45..e4c48a8 100644 --- a/app/admin/view/set/system/website.html +++ b/app/admin/view/set/system/website.html @@ -13,6 +13,7 @@
  • 邮箱服务
  • 服务配置
  • 域名绑定
  • +
  • 应用映射
  • URL美化
  • @@ -276,14 +277,14 @@
    - +
    如:www.aieok.com
    - +
    如:admin.aieok.com
    @@ -298,20 +299,43 @@
    +
    +
    +
    + +
    + +
    +
    改变后原路径访问无效
    +
    +
    + +
    + +
    +
    设置后需要使用新路径
    +
    +
    +
    + +
    +
    +
    +
    - +
    如:www.aieok.com/article/1.html
    - +
    如:www.aieok.com/cate/ask.html
    @@ -333,20 +357,20 @@
    {/block} {block name="js"} - +{volist name="push_js" id="vo"} +{$vo.jscode|raw} +{/volist} + {/block} \ No newline at end of file diff --git a/view/taoler/index/article/news/detail.html b/view/taoler/index/article/news/detail.html index 5a01c39..b157dad 100644 --- a/view/taoler/index/article/news/detail.html +++ b/view/taoler/index/article/news/detail.html @@ -10,37 +10,19 @@
    {//标题} -

    {$article.title}

    -
    - - {//图标} -
    - - - {$article.comments_count}{$pv} - -
    +

    {$article.title}

    + {//作者} -
    - - {$article.user.name} - - - -
    - - +
    +
    + {$article.user.name} / + {$article.create_time} + / {$pv}
    -
    +
    {// 内容} -
    {$article.content}
    +
    {$article.content}
    {//管理} {if (($article.upzip !== '') || session('?user_name'))} @@ -51,13 +33,17 @@
    {if ($user.auth ?? '')} - {if($article.is_top == 0)} - {else /}{:lang('cancel topping')}{/if} - {if($article.is_hot == 0)} + {if($article.is_top == 0)} + + {else /} + {:lang('cancel topping')} + {/if} + + {if($article.is_hot == 0)} - {else /} + {else /} {:lang('cancel hoting')} - {/if} + {/if} {if($article.is_reply == 1)} {else /} @@ -68,7 +54,7 @@ {if(session('user_name')==$article.user.name || ($user.auth ?? ''))} {:lang('edit')} {/if} -
    +
    {/if}
    @@ -192,8 +178,8 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){ //首次不执行 if(!first){ var page = obj.curr; - var url = "{:url('article/detail',['id'=>$article.id])}"; - var id = "{$article.id}"; + var url = "{:url('article/detail',['id'=>$article.id])}"; + var id = "{$article.id}"; $.post("{:url('article/detail')}",{"id":id,"page":page},function(){ window.location.href = url + '?page=' + page + '#flyReply'; }); @@ -306,18 +292,10 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){ }); } //推送百度收录服务 - (function(){ - var bp = document.createElement('script'); - var curProtocol = window.location.protocol.split(':')[0]; - if (curProtocol === 'https') { - bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; - } - else { - bp.src = 'http://push.zhanzhang.baidu.com/push.js'; - } - var s = document.getElementsByTagName("script")[0]; - s.parentNode.insertBefore(bp, s); - })(); +{volist name="push_js" id="vo"} +{$vo.jscode|raw} +{/volist} + {/block} \ No newline at end of file diff --git a/view/taoler/index/article/posts/detail.html b/view/taoler/index/article/posts/detail.html index 49b833c..1523813 100644 --- a/view/taoler/index/article/posts/detail.html +++ b/view/taoler/index/article/posts/detail.html @@ -391,20 +391,10 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){ content: " $article.id])}&size=230'>" }); } - - //推送百度收录服务 - (function(){ - var bp = document.createElement('script'); - var curProtocol = window.location.protocol.split(':')[0]; - if (curProtocol === 'https') { - bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; - } - else { - bp.src = 'http://push.zhanzhang.baidu.com/push.js'; - } - var s = document.getElementsByTagName("script")[0]; - s.parentNode.insertBefore(bp, s); - })(); +{volist name="push_js" id="vo"} +{$vo.jscode|raw} +{/volist} + {/block} \ No newline at end of file diff --git a/view/taoler/index/login/forget.html b/view/taoler/index/login/forget.html index a65f6cc..797a74f 100644 --- a/view/taoler/index/login/forget.html +++ b/view/taoler/index/login/forget.html @@ -7,7 +7,7 @@
    diff --git a/view/taoler/index/public/column.html b/view/taoler/index/public/column.html index a7a9438..eb43a16 100644 --- a/view/taoler/index/public/column.html +++ b/view/taoler/index/public/column.html @@ -6,7 +6,7 @@ {volist name="cateList" id="cate"}
  • - {:cookie('think_lang') == 'en-us' ? $cate.ename : $cate.catename}{if condition="$cate.is_hot eq 1"}{/if} + {:cookie('think_lang') == 'en-us' ? $cate.ename : $cate.catename}{if condition="$cate.is_hot eq 1"}{/if}
  • {/volist}
  • diff --git a/view/taoler/index/public/menu.html b/view/taoler/index/public/menu.html index 331c992..01cccd2 100644 --- a/view/taoler/index/public/menu.html +++ b/view/taoler/index/public/menu.html @@ -35,7 +35,7 @@ {volist name="cateList" id="cate"}
  • - {:cookie('think_lang') == 'en-us' ? $cate.ename : $cate.catename} + {:cookie('think_lang') == 'en-us' ? $cate.ename : $cate.catename} >> {$cate.ename} {if condition="$cate.is_hot eq 1"}{/if} diff --git a/view/taoler/index/user/message.html b/view/taoler/index/user/message.html index 3a09f17..710c039 100644 --- a/view/taoler/index/user/message.html +++ b/view/taoler/index/user/message.html @@ -1,3 +1,12 @@ + {extend name="public/user" /} {block name="content"}
    {/block} {block name="script"}