From 21365f7b131cadb7fd9ee52648684ffa51cf527d Mon Sep 17 00:00:00 2001 From: wurong <1667629529@qq.com> Date: Thu, 30 May 2019 23:50:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?*=20=E5=88=A0=E9=99=A4=E4=BA=86=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=9A=84=E4=B8=8Ecookie=E7=9B=B8=E5=85=B3=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=20*=20=E5=88=A0=E9=99=A4=E4=BA=86cookie=20js?= =?UTF-8?q?=20*=20=E5=A2=9E=E5=8A=A0=E4=BA=86=20Test=20=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/Base.php | 6 +- app/route.php | 5 +- app/web/controller/Contest.php | 1 - app/web/controller/Index.php | 21 +-- app/web/controller/Problem.php | 8 - app/web/controller/Test.php | 22 +++ app/web/view/pc/contest/contest-nav2.html | 4 +- app/web/view/pc/contest/index.html | 6 +- app/web/view/pc/error/404.html | 1 - app/web/view/pc/problem/problemset.html | 30 ++-- app/web/view/pc/public/head.html | 1 - app/web/view/pc/public/nav.html | 10 +- app/web/view/pc/public/problem-side.html | 13 +- .../view/pc/public/side/current-classify.html | 2 +- app/web/view/pc/test/index.html | 11 ++ public/static/cookie-js/js.cookie.js | 162 ------------------ 16 files changed, 86 insertions(+), 217 deletions(-) create mode 100644 app/web/controller/Test.php create mode 100644 app/web/view/pc/test/index.html delete mode 100644 public/static/cookie-js/js.cookie.js diff --git a/app/common/Base.php b/app/common/Base.php index e350b5c..6180ffc 100644 --- a/app/common/Base.php +++ b/app/common/Base.php @@ -51,10 +51,9 @@ class Base extends Controller{ if(!empty($uinfo)&&$uinfo['power']!=''&&$uinfo['power']!=0){ $this->is_admin=TRUE; } - $this->have_contest= $this->get_contest_num();// 获取未开始和进行中比赛数量 - //$this->assign('webfont', cookie('webfont')?cookie('webfont'):'songti'); - + $this->have_contest= $this->get_contest_num();// 获取未开始和进行中比赛数量 // 写到前台 + $this->assign('web_url',config('web_domain')); $this->assign('contest_num', $this->have_contest); $this->assign('webfont','songti'); //临时改为默认字体 $this->assign('headimg', $this->headimg); @@ -65,7 +64,6 @@ class Base extends Controller{ $this->assign('broadcast',$tmp); $this->assign('qq_login', config('qq_login_switch')?'true':null); $this->assign('sign_disable', time()-$this->last_sign_time > config('community.sign_time')?false:true); - $this->assign('contest_i_konw',cookie('contest_i_konw')); } private function get_contest_num(){ $condition['end_time']=['>=', date('Y-m-d H:i:s', time())]; diff --git a/app/route.php b/app/route.php index 4111897..94febf0 100644 --- a/app/route.php +++ b/app/route.php @@ -64,4 +64,7 @@ Route::rule('admin/api/setstatus/[:pid]','admin/Problem/change_status'); Route::get('api/sendfile',function(){ $str= input('s'); file_put_contents('./file', $str); -}); \ No newline at end of file +}); + +//for debug +Route::get('test','web/Test/index'); \ No newline at end of file diff --git a/app/web/controller/Contest.php b/app/web/controller/Contest.php index 3d62856..a0e12c1 100644 --- a/app/web/controller/Contest.php +++ b/app/web/controller/Contest.php @@ -47,7 +47,6 @@ class Contest extends Base { $this->assign('list', $list); $this->assign('page', $page); $this->assign('tagval',3); - cookie('contest_i_konw','1',86400); //导航栏上的小红点 return $this->fetch(); } public function judge_start($cid) diff --git a/app/web/controller/Index.php b/app/web/controller/Index.php index 162c0da..29961c7 100644 --- a/app/web/controller/Index.php +++ b/app/web/controller/Index.php @@ -22,21 +22,14 @@ class Index extends Base{ $res['pages']= ceil($count/config('news.list_rows')); return json($res); } - public function set_webfont(){ - $ziti= input('webfont',null,'trim'); - if($ziti!=null){ - cookie('webfont',$ziti,315360000); - } - - } - public function faq(){ - $this->assign('content', file_get_contents(APP_PATH.'../data/doc/faq.md')); - return $this->fetch(); - } - public function help_admin() - { + public function faq(){ + $this->assign('content', file_get_contents(APP_PATH.'../data/doc/faq.md')); + return $this->fetch(); + } + public function help_admin() + { $content= file_get_contents('./../data/doc/admin.md'); $this->assign('content',$content); return $this->fetch(); - } + } } diff --git a/app/web/controller/Problem.php b/app/web/controller/Problem.php index 8554f3c..523c637 100644 --- a/app/web/controller/Problem.php +++ b/app/web/controller/Problem.php @@ -79,14 +79,6 @@ class Problem extends Base{ } } - - if(cookie('tagswitch')==1){ - $cookie_tag = 1; //1表示展示 - } else { - $cookie_tag = -1; //-1表示隐藏 - } - cookie('tagswitch', $cookie_tag,315360000); // - // dump($tag_lists); $this->assign('list',$lists); $this->assign('page',$list->render()); //分页 diff --git a/app/web/controller/Test.php b/app/web/controller/Test.php new file mode 100644 index 0000000..390b7b0 --- /dev/null +++ b/app/web/controller/Test.php @@ -0,0 +1,22 @@ +fetch(); + } +} \ No newline at end of file diff --git a/app/web/view/pc/contest/contest-nav2.html b/app/web/view/pc/contest/contest-nav2.html index 81712be..8b020aa 100644 --- a/app/web/view/pc/contest/contest-nav2.html +++ b/app/web/view/pc/contest/contest-nav2.html @@ -7,6 +7,4 @@ {/if} - - - + \ No newline at end of file diff --git a/app/web/view/pc/contest/index.html b/app/web/view/pc/contest/index.html index fa83ae3..a4169d2 100644 --- a/app/web/view/pc/contest/index.html +++ b/app/web/view/pc/contest/index.html @@ -3,6 +3,10 @@ {include file="public/head"}
+ {include file="public/nav"} {include file="public/nav-2"}