Kaynağa Gözat

各种协议页面

lizhen_gitee 1 yıl önce
ebeveyn
işleme
6b93ff0586
1 değiştirilmiş dosya ile 4 ekleme ve 3 silme
  1. 4 3
      application/index/controller/Index.php

+ 4 - 3
application/index/controller/Index.php

@@ -4,6 +4,7 @@ namespace app\index\controller;
 
 use think\Controller;
 use think\Db;
+use think\Request;
 
 class Index extends Controller
 {
@@ -15,17 +16,17 @@ class Index extends Controller
 
     //基础文章网页
     public function basedata(){
-        $key = input('key','');
+        $key = input('key','','trim');
         if(!$key){
             exit;
         }
 
         $request = Request::instance();
-        $this->lang = $request->header('lang','CN');
+        $lang = $request->header('lang','zh-cn');
 
         $content = Db::name('basedata')->where('key',$key)->find();
 
-        if($lang == 'EN'){
+        if($lang == 'en'){
             $content['content'] = $content['content_en'];
         }
         $this->assign('content',$content['content']);