diff --git a/app/BaseController.php b/app/BaseController.php index 0b67da4..41ff30f 100644 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -243,11 +243,12 @@ abstract class BaseController /** * 获取文章链接地址 - * @param int $aid - * @param string $ename + * @param int $aid 文章id + * @param string $ename 所属分类ename + * @param string $appname 所属应用名 * @return string */ - protected function getRouteUrl(int $aid,string $ename = '') : string + protected function getRouteUrl(int $aid, string $ename = '', string $appname = '') : string { $indexUrl = $this->getIndexUrl(); if(config('taoler.url_rewrite.article_as') == '/'){ @@ -257,37 +258,61 @@ abstract class BaseController } else { $artUrl = (string) url('article_detail', ['id' => $aid]); } - //dump($artUrl); + + //多应用时,文章所属应用 2022.11.17 + $app = app('http')->getName(); + if(empty($appname)) { + // 获取article所属应用的应用名 + $cid = Db::name('article')->where('id',$aid)->value('cate_id'); + $appname = Db::name('cate')->where('id',$cid)->value('appname'); + } + + // 判断index应用是否绑定域名 + $bind_index = array_search($appname,config('app.domain_bind')); + // 判断index应用是否域名映射 + $map_index = array_search($appname,config('app.app_map')); + // article 所属应用名 + $index = $map_index ?: $appname; // index应用名 // 判断是否开启绑定 //$domain_bind = array_key_exists('domain_bind',config('app')); // 判断index应用是否绑定域名 - $bind_index = array_search('index',config('app.domain_bind')); + //$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')); + //$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应用名 +// $index = $map_index ?: 'index'; // index应用名 + $admin = $map_admin ?: 'admin'; // admin应用名 if($bind_index) { - // index绑定域名 - $url = $indexUrl . str_replace($admin.'/','',$artUrl); - } else { // index未绑定域名 - // admin绑定域名 +// echo 111; + // index或home前端(非admin应用)域名进行了绑定 + // url = $indexUrl . str_replace($admin . '/','',$artUrl); + $url = $indexUrl . $artUrl; + } else { if($bind_admin) { +// echo 222; + // admin绑定域名 $url = $indexUrl .'/' . $index . $artUrl; + } elseif ($app == 'admin' && isset($map_admin)) { +// echo 333; +// var_dump($admin, $appname, $artUrl); + // admin进行了映射 + $url = $indexUrl . str_replace($admin, $appname, $artUrl); } else { - $url = $indexUrl . str_replace($admin,$index,$artUrl); +// echo 444; + // admin未绑定域名 + $url = $indexUrl . str_replace($app, $appname, $artUrl); } - - } + } +//halt($url); return $url; } diff --git a/app/admin/controller/Forum.php b/app/admin/controller/Forum.php index da6a428..82af925 100644 --- a/app/admin/controller/Forum.php +++ b/app/admin/controller/Forum.php @@ -63,7 +63,7 @@ class Forum extends AdminController ->alias('a') ->join('user u','a.user_id = u.id') ->join('cate c','a.cate_id = c.id') - ->field('a.id as aid,ename,name,user_img,title,content,a.update_time as update_time,is_top,a.is_hot as is_hot,is_reply,a.status as status') + ->field('a.id as aid,ename,appname,name,user_img,title,content,a.update_time as update_time,is_top,a.is_hot as is_hot,is_reply,a.status as status') ->where('a.delete_time',0) ->where($map) ->where($where) @@ -76,7 +76,7 @@ class Forum extends AdminController $res['msg'] = ''; $res['count'] = $count; foreach($forumList as $k=>$v){ - $url = $this->getRouteUrl($v['aid'],$v['ename']); + $url = $this->getRouteUrl($v['aid'],$v['ename'],$v['appname']); $res['data'][]= ['id'=>$v['aid'],'poster'=>$v['name'],'avatar'=>$v['user_img'],'title'=>htmlspecialchars($v['title']),'url'=>$url,'content'=>htmlspecialchars($v['content']),'posttime'=>date("Y-m-d",$v['update_time']),'top'=>$v['is_top'],'hot'=>$v['is_hot'],'reply'=>$v['is_reply'],'check'=>$v['status']]; } } else { @@ -87,17 +87,6 @@ class Forum extends AdminController return View::fetch(); } - //编辑帖子 - public function listform() - { - if(Request::isAjax()){ - $data = Request::param(); - $form = Db::name('article')->find($data['id']); - //halt($form); - } - return View::fetch(); - } - //删除帖子 public function listdel($id) { @@ -246,7 +235,7 @@ class Forum extends AdminController ->join('user u','a.user_id = u.id') ->join('article c','a.article_id = c.id') ->join('cate ca','c.cate_id = ca.id') - ->field('a.id as aid,name,ename,title,user_img,a.content as content,a.create_time as create_time,a.status as astatus,c.id as cid') + ->field('a.id as aid,name,ename,appname,title,user_img,a.content as content,a.create_time as create_time,a.status as astatus,c.id as cid') ->where('a.delete_time',0) ->where($map) ->where($where) @@ -258,7 +247,7 @@ class Forum extends AdminController if ($count) { $res = ['code'=>0,'msg'=>'','count'=>$count]; foreach($replys as $k => $v){ - $url = $this->getRouteUrl($v['cid'],$v['ename']); + $url = $this->getRouteUrl($v['cid'],$v['ename'], $v['appname']); //$res['data'][] = ['id'=>$v['id'],'replyer'=>$v->user->name,'cardid'=>$v->article->title,'avatar'=>$v->user->user_img,'content'=>$v['content'],'replytime'=>$v['create_time']]; $res['data'][] = ['id'=>$v['aid'],'replyer'=>$v['name'],'title'=>htmlspecialchars($v['title']),'avatar'=>$v['user_img'],'content'=>htmlspecialchars($v['content']),'replytime'=>date("Y-m-d",$v['create_time']),'check'=>$v['astatus'],'url'=>$url]; } @@ -364,8 +353,8 @@ class Forum extends AdminController // 把,转换为,并去空格->转为数组->去掉空数组->再转化为带,号的字符串 $data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace(',',',',$data['keywords']))))); - // 获取分类ename - $cate_ename = Db::name('cate')->where('id',$data['cate_id'])->value('ename'); + // 获取分类ename,appname + $cateName = Db::name('cate')->field('ename,appname')->find($data['cate_id']); $article = new Article(); $result = $article->add($data); @@ -385,7 +374,7 @@ class Forum extends AdminController // 清除文章tag缓存 Cache::tag('tagArtDetail')->clear(); - $link = $this->getRouteUrl((int)$aid, $cate_ename); + $link = $this->getRouteUrl((int)$aid, $cateName['ename'],$cateName['appname']); // 推送给百度收录接口 $this->baiduPushUrl($link); @@ -463,7 +452,7 @@ class Forum extends AdminController } //删除原有缓存显示编辑后内容 Cache::delete('article_'.$id); - $link = $this->getRouteUrl((int) $id, $article->cate->ename); + $link = $this->getRouteUrl((int) $id, $article->cate->ename, $article->cate->appname); // 推送给百度收录接口 $this->baiduPushUrl($link); $editRes = Msgres::success('edit_success',$link); diff --git a/app/admin/controller/Menu.php b/app/admin/controller/Menu.php index 5d19337..97a80a9 100644 --- a/app/admin/controller/Menu.php +++ b/app/admin/controller/Menu.php @@ -3,6 +3,7 @@ namespace app\admin\controller; use app\common\controller\AdminController; use think\facade\Db; +use taoser\think\Auth; class Menu extends AdminController { @@ -20,8 +21,11 @@ class Menu extends AdminController */ public function getMenuNavbar() { + // 用户菜单权限 + $auth = new Auth(); + $pid = empty(input('id')) ? 0 : input('id'); - $data = Db::name('auth_rule')->field('id,title,icon,name,sort')->where(['delete_time'=> 0,'status'=> 1,'ismenu'=>1,'pid'=>$pid])->select(); + $data = Db::name('auth_rule')->field('id,title,icon,name,sort')->where(['pid'=>$pid,'status'=> 1, 'ismenu'=>1, 'delete_time'=> 0])->select(); $tree = []; foreach ($data as $k => $v) { $hasChild = $this->hasChildren($v['id']); @@ -30,7 +34,10 @@ class Menu extends AdminController } else { $v['hasChildren'] = 0; } - $tree[] = ['id'=>$v['id'],'text'=>$v['title'],'icon'=>$v['icon'],'hasChildren'=>$v['hasChildren'],'href'=>(string) url($v['name']),'sort'=>$v['sort']]; + if ($auth->check($v['name'], session('admin_id')) || session('admin_id') == 1) { + $tree[] = ['id'=>$v['id'],'text'=>$v['title'],'icon'=>$v['icon'],'hasChildren'=>$v['hasChildren'],'href'=>(string) url($v['name']),'sort'=>$v['sort']]; + } + } // 排序 $cmf_arr = array_column($tree, 'sort'); diff --git a/app/admin/controller/taocai/.gitignore b/app/admin/controller/taocai/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/app/admin/controller/taocai/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/app/admin/model/taocai/.gitignore b/app/admin/model/taocai/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/app/admin/model/taocai/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/app/admin/view/addons/index.html b/app/admin/view/addons/index.html index 3010a26..a505df6 100644 --- a/app/admin/view/addons/index.html +++ b/app/admin/view/addons/index.html @@ -23,7 +23,7 @@ {{# if(d.have_newversion === 1){ }} 升级 {{# } else { }} - {{# if(d.isInstall ===1) { }} + {{# if(d.isInstall === 1) { }} 设置 {{# } else { }} 安装 @@ -47,8 +47,8 @@ {include file="public/user_login" /} {/block} -{block name="js"} +{block name="js"} @@ -82,15 +82,12 @@ {block name="js"}js文件{/block} diff --git a/app/admin/view/taocai/.gitignore b/app/admin/view/taocai/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/app/admin/view/taocai/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/app/admin/view/upgrade/index.html b/app/admin/view/upgrade/index.html index 0d6a218..307128f 100644 --- a/app/admin/view/upgrade/index.html +++ b/app/admin/view/upgrade/index.html @@ -17,7 +17,7 @@
无Key不能升级
-
去官网申请Key
+
去官网申请Key
{else /}
diff --git a/app/admin/view/upgrade/keyedit.html b/app/admin/view/upgrade/keyedit.html index 7ef94ff..431455b 100644 --- a/app/admin/view/upgrade/keyedit.html +++ b/app/admin/view/upgrade/keyedit.html @@ -33,7 +33,7 @@
- +
未通知api接口变更,请不要私自更改api,否则无法升级
diff --git a/app/common/controller/AdminController.php b/app/common/controller/AdminController.php index 2b7d479..3e467c2 100644 --- a/app/common/controller/AdminController.php +++ b/app/common/controller/AdminController.php @@ -43,8 +43,7 @@ class AdminController extends \app\BaseController $admin_id = $this->aid; $auth = new Auth(); - $auth_rule_list = Db::name('auth_rule')->where(['delete_time'=> 0,'status'=> 1,'ismenu'=>1])->select(); - + $auth_rule_list = Db::name('auth_rule')->where(['status'=> 1, 'ismenu'=>1, 'delete_time'=> 0])->select(); foreach ($auth_rule_list as $value) { if ($auth->check($value['name'], $admin_id) || $admin_id == 1) { // 查询是否设置映射 diff --git a/app/common/controller/BaseController.php b/app/common/controller/BaseController.php index af0435f..42f5dc3 100644 --- a/app/common/controller/BaseController.php +++ b/app/common/controller/BaseController.php @@ -42,6 +42,10 @@ class BaseController extends BaseCtrl 'subcatelist' => $this->showSubnav(), //当前登录用户 'user' => $this->showUser($this->uid), + //多站点 + 'stationList' => $this->getStationList(), + // 当前站点 + 'city' => input('city') ?: Db::name('station')->where('master',1)->value('city_ename') ]); @@ -162,4 +166,17 @@ class BaseController extends BaseCtrl return $sysInfo; } + // 多站点 + protected function getStationList() + { + return $stationList = Db::name('station')->select()->toArray(); + } + + // + protected function getCity($cityname) + { + return Db::name('station')->field('city_name,city_ename')->where('city_ename', $cityname)->find(); + + } + } diff --git a/app/common/lib/Arts.php b/app/common/lib/Arts.php index 67e6f4f..6e50794 100644 --- a/app/common/lib/Arts.php +++ b/app/common/lib/Arts.php @@ -35,11 +35,12 @@ class Arts /** * 获取文章链接地址 - * @param int $aid - * @param string $ename + * @param int $aid 文章id + * @param string $ename 所属分类ename + * @param string $appname 所属应用名 * @return string */ - public function getRouteUrl(int $aid,string $ename = '') : string + public function getRouteUrl(int $aid, string $ename = '', string $appname = '') : string { $indexUrl = $this->getIndexUrl(); if(config('taoler.url_rewrite.article_as') == '/'){ @@ -49,33 +50,53 @@ class Arts } else { $artUrl = (string) url('article_detail', ['id' => $aid]); } - //dump($artUrl); + + //多应用时,文章所属应用 2022.11.17 + $app = app('http')->getName(); + if(empty($appname)) { + // 获取article所属应用的应用名 + $cid = Db::name('article')->where('id',$aid)->value('cate_id'); + $appname = Db::name('cate')->where('id',$cid)->value('appname'); + } + + // 判断index应用是否绑定域名 + $bind_index = array_search($appname,config('app.domain_bind')); + // 判断index应用是否域名映射 + $map_index = array_search($appname,config('app.app_map')); + // article 所属应用名 + $index = $map_index ?: $appname; // index应用名 // 判断是否开启绑定 //$domain_bind = array_key_exists('domain_bind',config('app')); // 判断index应用是否绑定域名 - $bind_index = array_search('index',config('app.domain_bind')); + //$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')); + //$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应用名 +// $index = $map_index ?: 'index'; // index应用名 + $admin = $map_admin ?: 'admin'; // admin应用名 if($bind_index) { - // index绑定域名 - $url = $indexUrl . str_replace($admin.'/','',$artUrl); - } else { // index未绑定域名 - // admin绑定域名 + // index或home前端(非admin应用)域名进行了绑定 + // url = $indexUrl . str_replace($admin . '/','',$artUrl); + $url = $indexUrl . $artUrl; + } else { if($bind_admin) { + // admin绑定域名 $url = $indexUrl .'/' . $index . $artUrl; + } elseif ($app == 'admin' && isset($map_admin)) { + // admin进行了映射 + $url = $indexUrl . str_replace($admin, $appname, $artUrl); } else { - $url = $indexUrl . str_replace($admin,$index,$artUrl); + + // admin未绑定域名 + $url = $indexUrl . str_replace($app, $appname, $artUrl); } } @@ -300,7 +321,7 @@ class Arts //下载远程图片 - private function downloadImage($url) + private function downloadImage($url, $userId = 1) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, 'GET' ); @@ -310,18 +331,19 @@ class Arts curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); $file = curl_exec($ch); curl_close($ch); - return $this->saveAsImage($url, $file); + return $this->saveAsImage($url, $file, $userId); } //把图片保存到本地 - private function saveAsImage($url, $file) + private function saveAsImage($url, $file, $userId = 1) { $filename = pathinfo($url, PATHINFO_BASENAME); //$dirname = pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_DIRNAME); $dirname = date('Ymd',time()); + $uid = session('user_id') ?: $userId; //路径 - $path = 'storage/' . $this->uid . '/article_pic/' . $dirname . '/'; + $path = 'storage/' . $uid . '/article_pic/' . $dirname . '/'; //绝对文件夹 $fileDir = public_path() . $path; //文件绝对路径 @@ -349,7 +371,7 @@ class Arts } //下载网络图片到本地并替换 - public function downUrlPicsReaplace($content) + public function downUrlPicsReaplace($content, $userId = 1) { // 批量下载网络图片并替换 $images = $this->getArticleAllpic($content); @@ -359,7 +381,7 @@ class Arts if((stripos($image,'http') !== false) && (stripos($image, Request::domain()) === false) && (stripos($image, '?') === false)) { // 如果图片中没有带参数或者加密可下载 //下载远程图片(可下载) - $newImageUrl = $this->downloadImage($image); + $newImageUrl = $this->downloadImage($image, $userId); //替换图片链接 $content = str_replace($image,Request::domain().$newImageUrl,$content); } diff --git a/app/common/model/Cate.php b/app/common/model/Cate.php index 807f11f..faf5eab 100644 --- a/app/common/model/Cate.php +++ b/app/common/model/Cate.php @@ -33,6 +33,12 @@ class Cate extends Model return $this->field('ename,catename,detpl,desc')->where('ename',$ename)->cache('cate_'.$ename,600)->find(); } + // 查询子分类 + public function getSubCate(string $ename) + { + return $this->field('ename,catename')->where('pid', $this::where('ename', $ename)->value('id'))->select(); + } + // 删除类别 public function del($id) { diff --git a/app/common/model/UpgradeAuth.php b/app/common/model/UpgradeAuth.php index b25981d..e065b94 100644 --- a/app/common/model/UpgradeAuth.php +++ b/app/common/model/UpgradeAuth.php @@ -18,7 +18,7 @@ class UpgradeAuth extends Model public function getAuthLevelAttr($value) { - $level = [0=>'免费版', 1=>'初级版', 2=>'中级版', 3=>'高级版']; + $level = [0=>'免费', 1=>'初级', 2=>'中级', 3=>'高级']; return $level[$value]; } diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index 6249dd0..a83c05c 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -207,11 +207,10 @@ class Article extends BaseController if (Comment::create($data)) { //站内信 $article = Db::name('article')->field('id,title,user_id,cate_id')->where('id',$data['article_id'])->find(); - // 获取分类ename - $cate_ename = Db::name('cate')->where('id',$article['cate_id'])->value('ename'); - $title = $article['title']; + // 获取分类ename,appname + $cateName = Db::name('cate')->field('ename,appname')->find($article['cate_id']); //$link = (string) url('article_detail',['id'=>$data['article_id']]); - $link = $this->getRouteUrl($data['article_id'], $cate_ename); + $link = $this->getRouteUrl($data['article_id'], $cateName['ename'], $cateName['appname']); //评论中回复@user comment $preg = "/@([^@\s]*)\s/"; @@ -268,9 +267,9 @@ class Article extends BaseController // 把中文,转换为英文,并去空格->转为数组->去掉空数组->再转化为带,号的字符串 $data['keywords'] = implode(',',array_filter(explode(',',trim(str_replace(',',',',$data['keywords']))))); - // 获取分类ename - $cate_ename = Db::name('cate')->where('id',$data['cate_id'])->value('ename'); - + // 获取分类ename,appname + $cateName = Db::name('cate')->field('ename,appname')->find($data['cate_id']); + $article = new ArticleModel(); $result = $article->add($data); @@ -292,7 +291,7 @@ class Article extends BaseController // 发提醒邮件 if(Config::get('taoler.config.email_notice')) hook('mailtohook',[$this->showUser(1)['email'],'发帖审核通知','Hi亲爱的管理员:
用户'.$this->showUser($this->uid)['name'].'刚刚发表了 '.$data['title'].' 新的帖子,请尽快处理。']); - $link = $this->getRouteUrl((int)$aid, $cate_ename); + $link = $this->getRouteUrl((int)$aid, $cateName['ename'], $cateName['appname']); // 推送给百度收录接口 $this->baiduPushUrl($link); @@ -393,7 +392,7 @@ class Article extends BaseController //删除原有缓存显示编辑后内容 Cache::delete('article_'.$id); - $link = $this->getRouteUrl((int) $id, $article->cate->ename); + $link = $this->getRouteUrl((int) $id, $article->cate->ename, $article->cate->appname); // 推送给百度收录接口 $this->baiduPushUrl($link); $editRes = Msgres::success('edit_success',$link); diff --git a/app/index/controller/Login.php b/app/index/controller/Login.php index 0b2daa1..7128406 100644 --- a/app/index/controller/Login.php +++ b/app/index/controller/Login.php @@ -36,7 +36,8 @@ class Login extends BaseController return redirect((string) url('user/index')); } //获取登录前访问页面refer - $refer = Request::server('HTTP_REFERER'); + $refer = str_replace(Request::domain(), '', Request::server('HTTP_REFERER')); + Cookie::set('refer', $refer); if(Request::isAjax()) { // 检验登录是否开放 if(config('taoler.config.is_login') == 0 ) return json(['code'=>-1,'msg'=>'抱歉,网站维护中,暂时不能登录哦!']); @@ -83,8 +84,7 @@ class Login extends BaseController $user = new User(); $res = $user->login($data); if ($res == 1) { //登陆成功 - $user = $user->getLoggedUser(); - return Msgres::success('login_success',$refer); + return Msgres::success('login_success', Cookie::get('refer')); } else { return Msgres::error($res); } diff --git a/app/index/controller/User.php b/app/index/controller/User.php index a3b02e5..56313e7 100644 --- a/app/index/controller/User.php +++ b/app/index/controller/User.php @@ -29,21 +29,28 @@ class User extends BaseController } - // 发帖list + // 我的发帖list public function artList() { - $article = Article::withCount('comments')->where(['user_id'=>$this->uid])->order('update_time','desc')->paginate(10); - $count = $article->total(); + $param = Request::only(['page','limit']); + $myArticle = Article::field('id,cate_id,title,status,pv,create_time') + ->withCount(['comments']) + ->where(['user_id'=>$this->uid]) + ->order('update_time','desc') + ->paginate([ + 'list_rows' => $param['limit'], + 'page' => $param['page'] + ]); + $count = $myArticle->total(); $res = []; if($count){ $res['code'] = 0; $res['count'] = $count; - foreach($article as $v){ + foreach($myArticle as $v){ $res['data'][] = ['id'=>$v['id'], 'title' => htmlspecialchars($v['title']), - 'url' => (string) url('article/detail',['id'=>$v['id']]), - 'url' => $this->getRouteUrl($v['id'], $v->cate->ename), - 'status' => $v['status'] ? '正常':'待审核', + 'url' => $this->getRouteUrl($v['id'], $v->cate->ename, $v->cate->appname), + 'status' => $v['status'] ? '正常':'待审', 'ctime' => $v['create_time'], 'datas' => $v['pv'].'阅/'.$v['comments_count'].'答' ]; diff --git a/app/index/route/.gitignore b/app/index/route/.gitignore new file mode 100644 index 0000000..a43c5df --- /dev/null +++ b/app/index/route/.gitignore @@ -0,0 +1 @@ +myroute.php \ No newline at end of file diff --git a/app/install/data/taoler.sql b/app/install/data/taoler.sql index 410f511..83a8076 100644 --- a/app/install/data/taoler.sql +++ b/app/install/data/taoler.sql @@ -474,6 +474,26 @@ CREATE TABLE `tao_slider` ( INSERT INTO `tao_slider` VALUES ('1', 'CODING', '1', '/storage/slider/F1.jpg', '#', '', '1574870400', '1575043200', '1', '0', '0', '0'); INSERT INTO `tao_slider` VALUES ('2', '通用右栏底部广告', '2', '/storage/slider/20200101/851c0b88a72590293bcb45454bdce056.jpg', 'https://www.aieok.com', '', '1571155200', '1609344000', '1', '0', '0', '0'); +-- ---------------------------- +-- Table structure for tao_station +-- ---------------------------- +DROP TABLE IF EXISTS `tao_station`; +CREATE TABLE `tao_station` ( + `id` int NOT NULL AUTO_INCREMENT, + `city_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `city_ename` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `master` tinyint(1) NOT NULL DEFAULT 0, + `create_time` datetime NOT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `ename`(`city_ename` ASC) USING BTREE COMMENT 'ename索引' +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of tao_station +-- ---------------------------- +INSERT INTO `tao_station` VALUES (1, '北京', 'beijing', 1, '2011-11-11 00:00:00'); +INSERT INTO `tao_station` VALUES (2, '上海', 'shanghai', 0, '2222-11-21 08:08:08'); + -- ---------------------------- -- Table structure for tao_system -- ---------------------------- @@ -492,7 +512,7 @@ CREATE TABLE `tao_system` ( `copyright` varchar(100) NOT NULL DEFAULT '' COMMENT '版权', `keywords` tinytext NOT NULL COMMENT '网站关键字', `descript` text NOT NULL COMMENT '网站描述', - `state` tinytext CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '网站声明', + `state` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '网站声明', `is_open` enum('0','1') NOT NULL DEFAULT '1' COMMENT '是否开启站点1开启0关闭', `is_comment` enum('0','1') NOT NULL DEFAULT '1' COMMENT '是否开启评论1开启0关闭', `is_reg` enum('0','1') NOT NULL DEFAULT '1' COMMENT '是否开放注册1开启0禁止', diff --git a/app/middleware/Auth.php b/app/middleware/Auth.php index 0431f43..6d0b267 100644 --- a/app/middleware/Auth.php +++ b/app/middleware/Auth.php @@ -17,6 +17,7 @@ use think\facade\Session; use think\facade\Cookie; use think\facade\Db; use think\facade\Config; +use think\facade\Request; class Auth { @@ -29,8 +30,11 @@ class Auth */ public function handle($request, \Closure $next) { +// var_dump(Request::url(),Request::pathinfo(),$request->baseUrl(),$request->controller()); //访问路径 - $path = app('http')->getName().'/'.stristr($request->pathinfo(),".html",true); +// $path = app('http')->getName().'/'.stristr($request->pathinfo(),".html",true); + $path = stristr($request->pathinfo(),".html",true); + //登陆前获取加密的Cookie $cooAuth = Cookie::get('adminAuth'); @@ -43,7 +47,7 @@ class Auth //验证cookie $salt = Config::get('taoler.salt'); $auth = md5($user['username'].$salt).":".$userId; - if($auth==$cooAuth){ + if($auth == $cooAuth){ Session::set('admin_name',$user['username']); Session::set('admin_id',$userId); } @@ -51,19 +55,49 @@ class Auth } - //没有登录及当前非登录页重定向登录页 - if(!Session::has('admin_id') && $path !== 'admin/login/index' && !(stristr($request->pathinfo(),"captcha.html") || stristr($request->pathinfo(),"addons")) ) - { - return redirect((string) url('login/index')); - } - - //登陆后无法访问登录页 - if(Session::has('admin_id') && $path == 'admin/login/index'){ - return redirect((string) url('index/index')); - } - - // 排除公共权限 - $not_check = ['admin/','admin/login/index','admin/index/index','admin/index/home','admin/Admin/info','admin/Admin/repass','admin/Admin/logout','admin/Index/news','admin/Index/cunsult','admin/Index/replys','admin/Index/reply','admin/captcha','addons/socail/','admin/addons/social/oauth/login','admin/addons/bacimg/index/getImages']; +// //没有登录及当前非登录页重定向登录页 +// if(!Session::has('admin_id') && $path !== 'admin/login/index' && !(stristr($request->pathinfo(),"captcha.html") || stristr($request->pathinfo(),"addons")) ) +// { +// return redirect((string) url('login/index')); +// } +// //登陆后无法访问登录页 +// if(Session::has('admin_id') && $path == 'admin/login/index'){ +// return redirect((string) url('index/index')); +// } +// // 排除公共权限 +// $not_check = ['admin/','index/index', 'admin/menu/getMenuNavbar','admin/login/index','admin/index/index','admin/index/home','admin/Admin/info','admin/Admin/repass','admin/Admin/logout','admin/Index/news','admin/Index/cunsult','admin/Index/replys','admin/Index/reply','admin/captcha','addons/socail/','admin/addons/social/oauth/login','admin/addons/bacimg/index/getImages']; + + + //没有登录及当前非登录页重定向登录页 + if(!Session::has('admin_id') && $path !== 'login/index' && !(stristr($request->pathinfo(),"captcha.html") || stristr($request->pathinfo(),"addons")) ) + { + return redirect((string) url('login/index')); + } + //登陆后无法访问登录页 + if(Session::has('admin_id') && $path == 'login/index' || $path == ''){ + return redirect((string) url('index/index')); + } + + // 排除公共权限 + $not_check = [ + 'captcha', + 'admin/index', + 'index/index', + 'menu/getMenuNavbar', + 'login/index', + 'index/home', + 'Admin/info', + 'Admin/repass', + 'Admin/logout', + 'Index/news', + 'Index/cunsult', + 'Index/replys', + 'Index/reply', + 'admin/captcha', + 'addons/socail/', + 'addons/social/oauth/login', + 'addons/bacimg/index/getImages' + ]; if (!in_array($path, $not_check)) { $auth = new UserAuth(); diff --git a/composer.lock b/composer.lock index 6d6a99f..9e4e57e 100644 --- a/composer.lock +++ b/composer.lock @@ -2277,16 +2277,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.46", + "version": "v4.4.47", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "90425fd98d1ecad98e4b2dca9f54f62069193b15" + "reference": "1069c7a3fca74578022fab6f81643248d02f8e63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/90425fd98d1ecad98e4b2dca9f54f62069193b15", - "reference": "90425fd98d1ecad98e4b2dca9f54f62069193b15", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63", + "reference": "1069c7a3fca74578022fab6f81643248d02f8e63", "shasum": "", "mirrors": [ { @@ -2352,7 +2352,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.46" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.47" }, "funding": [ { @@ -2368,7 +2368,7 @@ "type": "tidelift" } ], - "time": "2022-09-03T23:07:25+00:00" + "time": "2022-10-03T15:15:11+00:00" }, { "name": "symfony/var-exporter", @@ -3326,16 +3326,16 @@ }, { "name": "workerman/workerman", - "version": "v4.1.3", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/walkor/workerman.git", - "reference": "01028d8008c5691ec38c5f675fc13d76496a6db9" + "reference": "83e007acf936e2233ac92d7368b87716f2bae338" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/walkor/workerman/zipball/01028d8008c5691ec38c5f675fc13d76496a6db9", - "reference": "01028d8008c5691ec38c5f675fc13d76496a6db9", + "url": "https://api.github.com/repos/walkor/workerman/zipball/83e007acf936e2233ac92d7368b87716f2bae338", + "reference": "83e007acf936e2233ac92d7368b87716f2bae338", "shasum": "", "mirrors": [ { @@ -3391,7 +3391,7 @@ "type": "patreon" } ], - "time": "2022-09-23T14:05:12+00:00" + "time": "2022-10-09T11:33:14+00:00" }, { "name": "yansongda/pay", diff --git a/config/taoler.php b/config/taoler.php index 8eaf3b2..745fb79 100644 --- a/config/taoler.php +++ b/config/taoler.php @@ -16,7 +16,7 @@ return [ // 应用名,此项不可更改 'appname' => 'TaoLer', // 版本配置 - 'version' => '2.1.0', + 'version' => '2.1.1', // 加盐 'salt' => 'taoler', // 数据库备份目录 diff --git a/public/static/admin/modules/addons.js b/public/static/admin/modules/addons.js index 6d006ac..f8df51d 100644 --- a/public/static/admin/modules/addons.js +++ b/public/static/admin/modules/addons.js @@ -106,7 +106,7 @@ layui.define(["table", "form", "upload","notify","hxNav"], function (exports) { layer.close(index); layer.open({ type: 2, - area: ['80%', '90%'], + area: ['50%', '65%'], fixed: false, //不固定 maxmin: true, content: 'pay.html'+ "?id=" + data.id+ "&name=" + data.name + "&version=" + data.version + "&uid=" + userinfo.uid + "&price=" + data.price, diff --git a/public/static/admin/modules/forum.js b/public/static/admin/modules/forum.js index 37046ad..0bc7d32 100644 --- a/public/static/admin/modules/forum.js +++ b/public/static/admin/modules/forum.js @@ -30,16 +30,17 @@ var forms = table.render({ //监听工具条 table.on('tool(LAY-app-forum-list)', function(obj){ var data = obj.data; + var url = $(this).data('url'); if(obj.event === 'del'){ layer.confirm('确定删除此条帖子?', function(index){ //obj.del(); $.ajax({ type:'post', - url:forumListdel, + url:url, data:{id:data.id}, dataType:'json', success:function(data){ - if(data.code == 0){ + if(data.code === 0){ layer.msg(data.msg,{ icon:6, time:2000 @@ -64,7 +65,7 @@ var forms = table.render({ layer.open({ type: 2 ,title: '编辑帖子' - ,content: forumEdit + '?id='+ data.id + ,content: url + '?id='+ data.id ,area: ['100%', '100%'] ,btn: ['确定', '取消'] ,resize: false @@ -85,11 +86,11 @@ var forms = table.render({ $.ajax({ type:"post", - url: forumEdit, + url: url, data: field, daType:"json", success:function (data){ - if (data.code == 0) { + if (data.code === 0) { layer.msg(data.msg,{icon:6,time:2000}); } else { layer.open({title:'编辑失败',content:data.msg,icon:5,anim:6}); @@ -140,7 +141,7 @@ var forms = table.render({ data:{id:data.id}, dataType:'json', success:function(data){ - if(data.code == 0){ + if(data.code === 0){ layer.msg(data.msg,{ icon:6, time:2000 diff --git a/public/static/admin/modules/hxNav.js b/public/static/admin/modules/hxNav.js index 41c14e8..2c9dbd8 100644 --- a/public/static/admin/modules/hxNav.js +++ b/public/static/admin/modules/hxNav.js @@ -26,7 +26,7 @@ ''+ '
'+ '
'+ - '控制台'+ + '控制台'+ '
'+ '
'+ ''; diff --git a/public/static/admin/modules/useradmin.js b/public/static/admin/modules/useradmin.js index a03f1a2..b2d574b 100644 --- a/public/static/admin/modules/useradmin.js +++ b/public/static/admin/modules/useradmin.js @@ -22,17 +22,17 @@ layui.define(['table', 'form', 'notify'], function(exports){ {type: 'checkbox'} ,{field: 'id', width: 60, title: 'ID', sort: true} ,{field: 'username', title: '用户名', minWidth: 80} - ,{field: 'nick', title: '昵称',Width: 80} + ,{field: 'nick', title: '昵称',width: 80} ,{field: 'avatar', title: '头像', width: 60, templet: '#imgTpl'} //,{field: 'phone', title: '手机',width: 80} ,{field: 'email', title: '邮箱', minWidth: 120} ,{field: 'sex', width: 60, title: '性别',templet: '#sex'} - ,{field: 'ip', title: '登录IP', width: 100} + ,{field: 'ip', title: '登录IP', width: 120} ,{field: 'city', title: '城市', width: 80} ,{field: 'logintime', title: '最后登录',width: 150, sort: true} ,{field: 'jointime', title: '注册时间',width: 110, sort: true} ,{field: 'check', title: '状态', templet: '#buttonCheck', width: 95, align: 'center'} - ,{field: 'auth', title: '超级管理员', templet: '#buttonAuth', width: 80, align: 'center'} + ,{field: 'auth', title: '超管', templet: '#buttonAuth', width: 60, align: 'center'} ,{title: '操作', width: 100, align:'center', toolbar: '#table-useradmin-webuser'} ]] ,page: true diff --git a/runtime/update.sql b/runtime/update.sql index 583b024..b47d964 100644 --- a/runtime/update.sql +++ b/runtime/update.sql @@ -1 +1,18 @@ -ALTER TABLE `tao_cate` ADD `appname` varchar(20) NOT NULL DEFAULT 'index' COMMENT '所属应用' AFTER `status`; \ No newline at end of file +ALTER TABLE `tao_system` modify `state` text DEFAULT NULL COMMENT '网站声明'; + +DROP TABLE IF EXISTS `tao_station`; +CREATE TABLE `tao_station` ( + `id` int NOT NULL AUTO_INCREMENT, + `city_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `city_ename` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `master` tinyint(1) NOT NULL DEFAULT 0, + `create_time` datetime NOT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `ename`(`city_ename` ASC) USING BTREE COMMENT 'ename索引' +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of tao_station +-- ---------------------------- +INSERT INTO `tao_station` VALUES (1, '北京', 'beijing', 1, '2011-11-11 00:00:00'); +INSERT INTO `tao_station` VALUES (2, '上海', 'shanghai', 0, '2222-11-21 08:08:08'); \ No newline at end of file diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 5d6af7a..52d8c00 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -2238,17 +2238,17 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.46", - "version_normalized": "4.4.46.0", + "version": "v4.4.47", + "version_normalized": "4.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "90425fd98d1ecad98e4b2dca9f54f62069193b15" + "reference": "1069c7a3fca74578022fab6f81643248d02f8e63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/90425fd98d1ecad98e4b2dca9f54f62069193b15", - "reference": "90425fd98d1ecad98e4b2dca9f54f62069193b15", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63", + "reference": "1069c7a3fca74578022fab6f81643248d02f8e63", "shasum": "", "mirrors": [ { @@ -2278,7 +2278,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2022-09-03T23:07:25+00:00", + "time": "2022-10-03T15:15:11+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -2316,7 +2316,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.46" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.47" }, "funding": [ { @@ -3339,17 +3339,17 @@ }, { "name": "workerman/workerman", - "version": "v4.1.3", - "version_normalized": "4.1.3.0", + "version": "v4.1.4", + "version_normalized": "4.1.4.0", "source": { "type": "git", "url": "https://github.com/walkor/workerman.git", - "reference": "01028d8008c5691ec38c5f675fc13d76496a6db9" + "reference": "83e007acf936e2233ac92d7368b87716f2bae338" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/walkor/workerman/zipball/01028d8008c5691ec38c5f675fc13d76496a6db9", - "reference": "01028d8008c5691ec38c5f675fc13d76496a6db9", + "url": "https://api.github.com/repos/walkor/workerman/zipball/83e007acf936e2233ac92d7368b87716f2bae338", + "reference": "83e007acf936e2233ac92d7368b87716f2bae338", "shasum": "", "mirrors": [ { @@ -3364,7 +3364,7 @@ "suggest": { "ext-event": "For better performance. " }, - "time": "2022-09-23T14:05:12+00:00", + "time": "2022-10-09T11:33:14+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index be7714a..345b589 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'taoser/taoler', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '22c5b7c31c4425068784b5e30b6cae18549c4190', + 'reference' => '70c9f4a1c46ca50786773a38e86e10cf67fc15aa', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -338,9 +338,9 @@ 'dev_requirement' => false, ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v4.4.46', - 'version' => '4.4.46.0', - 'reference' => '90425fd98d1ecad98e4b2dca9f54f62069193b15', + 'pretty_version' => 'v4.4.47', + 'version' => '4.4.47.0', + 'reference' => '1069c7a3fca74578022fab6f81643248d02f8e63', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), @@ -358,7 +358,7 @@ 'taoser/taoler' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '22c5b7c31c4425068784b5e30b6cae18549c4190', + 'reference' => '70c9f4a1c46ca50786773a38e86e10cf67fc15aa', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -518,9 +518,9 @@ 'dev_requirement' => false, ), 'workerman/workerman' => array( - 'pretty_version' => 'v4.1.3', - 'version' => '4.1.3.0', - 'reference' => '01028d8008c5691ec38c5f675fc13d76496a6db9', + 'pretty_version' => 'v4.1.4', + 'version' => '4.1.4.0', + 'reference' => '83e007acf936e2233ac92d7368b87716f2bae338', 'type' => 'library', 'install_path' => __DIR__ . '/../workerman/workerman', 'aliases' => array(), diff --git a/vendor/services.php b/vendor/services.php index 75cb3e2..e5fd74d 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'taoser\\addons\\Service', diff --git a/vendor/symfony/var-dumper/Resources/bin/var-dump-server b/vendor/symfony/var-dumper/Resources/bin/var-dump-server index 98c813a..f398fce 100644 --- a/vendor/symfony/var-dumper/Resources/bin/var-dump-server +++ b/vendor/symfony/var-dumper/Resources/bin/var-dump-server @@ -10,6 +10,10 @@ * file that was distributed with this source code. */ +if ('cli' !== PHP_SAPI) { + throw new Exception('This script must be run from the command line.'); +} + /** * Starts a dump server to collect and output dumps on a single place with multiple formats support. * diff --git a/vendor/taoser/think-auth/src/Auth.php b/vendor/taoser/think-auth/src/Auth.php index 61488e9..8f6c08d 100644 --- a/vendor/taoser/think-auth/src/Auth.php +++ b/vendor/taoser/think-auth/src/Auth.php @@ -162,6 +162,7 @@ class Auth } // 获取用户需要验证的所有有效规则列表 $authList = $this->getAuthList($uid, $type); +// halt($authList); if (is_string($name)) { $name = strtolower($name); if (strpos($name, ',') !== false) { diff --git a/vendor/workerman/workerman/Connection/ConnectionInterface.php b/vendor/workerman/workerman/Connection/ConnectionInterface.php index 4d3f5e1..5d815d8 100644 --- a/vendor/workerman/workerman/Connection/ConnectionInterface.php +++ b/vendor/workerman/workerman/Connection/ConnectionInterface.php @@ -16,6 +16,7 @@ namespace Workerman\Connection; /** * ConnectionInterface. */ +#[\AllowDynamicProperties] abstract class ConnectionInterface { /** diff --git a/vendor/workerman/workerman/Worker.php b/vendor/workerman/workerman/Worker.php index 738b171..f26eaab 100644 --- a/vendor/workerman/workerman/Worker.php +++ b/vendor/workerman/workerman/Worker.php @@ -26,6 +26,7 @@ use \Exception; * Worker class * A container for listening ports */ +#[\AllowDynamicProperties] class Worker { /** @@ -33,7 +34,7 @@ class Worker * * @var string */ - const VERSION = '4.1.3'; + const VERSION = '4.1.4'; /** * Status starting. @@ -637,9 +638,18 @@ class Worker if (\DIRECTORY_SEPARATOR !== '/') { return; } - $fd = $fd ?: \fopen(static::$pidFile . '.lock', 'a+'); + $lock_file = static::$pidFile . '.lock'; + $fd = $fd ?: \fopen($lock_file, 'a+'); if ($fd) { flock($fd, $flag); + if ($flag === \LOCK_UN) { + fclose($fd); + $fd = null; + clearstatcache(); + if (\is_file($lock_file)) { + unlink($lock_file); + } + } } } diff --git a/view/taoler/index/article/add.html b/view/taoler/index/article/add.html index 03c9d34..0c2d377 100644 --- a/view/taoler/index/article/add.html +++ b/view/taoler/index/article/add.html @@ -313,7 +313,6 @@ // 发布文章 form.on("submit(article-add)", function (data) { var field = data.field; - console.log(field) var index = layer.load(1); $.ajax({ type: "post", diff --git a/view/taoler/index/article/ask/detail.html b/view/taoler/index/article/ask/detail.html index 4e6ff3f..55b527c 100644 --- a/view/taoler/index/article/ask/detail.html +++ b/view/taoler/index/article/ask/detail.html @@ -51,7 +51,7 @@ {/notempty}
{/if} -
本文链接:{$Request.domain}{$Request.url}
+ {notempty name="tags"}
标签 {volist name="tags" id="vo" } @@ -60,8 +60,9 @@
{/notempty}
-

{$sysInfo.state}

+

{$sysInfo.state|raw}

+
本文链接:{$Request.domain}{$Request.url}
{//评论内容} diff --git a/view/taoler/index/article/blog/detail.html b/view/taoler/index/article/blog/detail.html index 0205512..afb7a80 100644 --- a/view/taoler/index/article/blog/detail.html +++ b/view/taoler/index/article/blog/detail.html @@ -59,7 +59,7 @@ {/notempty} {/if} -
本文链接:{$Request.domain}{$Request.url}
+ {notempty name="tags"}
标签 {volist name="tags" id="vo" } @@ -68,8 +68,9 @@
{/notempty}
-

{$sysInfo.state}

+

{$sysInfo.state|raw}

+
本文链接:{$Request.domain}{$Request.url}
点赞 {:count($userZanList)} diff --git a/view/taoler/index/article/edit.html b/view/taoler/index/article/edit.html index 623ab7f..9b35d5a 100644 --- a/view/taoler/index/article/edit.html +++ b/view/taoler/index/article/edit.html @@ -261,7 +261,6 @@ $(function(){ function getBdiduWords(flag,title,content) { $.post("{:url('article/keywords')}",{ keywords: title, content:content, flag: flag }, function (res) { if (res.code == 0) { - console.log(res.data) $("input[name='keywords']").val(res.data.join(',')); } }, diff --git a/view/taoler/index/article/news/detail.html b/view/taoler/index/article/news/detail.html index b0e2985..76d05ea 100644 --- a/view/taoler/index/article/news/detail.html +++ b/view/taoler/index/article/news/detail.html @@ -18,7 +18,7 @@
{//标题} -

{$article.title}

+

{$article.title}

{//作者}
@@ -39,7 +39,7 @@ {/notempty}
{/if} - + {notempty name="tags"}
标签 {volist name="tags" id="vo" } @@ -48,8 +48,9 @@
{/notempty}
-

{$sysInfo.state}

+

{$sysInfo.state|raw}

+
{//crud管理模块} diff --git a/view/taoler/index/article/posts/detail.html b/view/taoler/index/article/posts/detail.html index e1047f0..9e3b588 100644 --- a/view/taoler/index/article/posts/detail.html +++ b/view/taoler/index/article/posts/detail.html @@ -62,7 +62,7 @@ {/notempty}
{/if} -
本文链接:{$Request.domain}{$Request.url}
+ {notempty name="tags"}
标签 {volist name="tags" id="vo" } @@ -71,8 +71,9 @@
{/notempty}
-

{$sysInfo.state}

+

{$sysInfo.state|raw}

+
本文链接:{$Request.domain}{$Request.url}
点赞 {:count($userZanList)} diff --git a/view/taoler/index/public/user.html b/view/taoler/index/public/user.html index 57315f6..2a4692a 100644 --- a/view/taoler/index/public/user.html +++ b/view/taoler/index/public/user.html @@ -15,7 +15,7 @@ - + {block name="css"}{/block} diff --git a/view/taoler/index/user/set.html b/view/taoler/index/user/set.html index 0bc0b8c..83f2fbd 100644 --- a/view/taoler/index/user/set.html +++ b/view/taoler/index/user/set.html @@ -33,7 +33,7 @@
- +
@@ -133,7 +133,7 @@ data:field, dataType:"json", success:function(data){ - if(data.code == 0){ + if(data.code === 0){ layer.msg(data.msg,{icon:6,tiye:2000},function(){ location.reload(); }); @@ -153,7 +153,7 @@ data:field, dataType:"json", success:function(data){ - if(data.code == 1){ + if(data.code === 1){ layer.msg(data.msg,{icon:6,tiye:2000},function(){ location.reload(); });