You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.3 KiB
52 lines
1.3 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Author: rainfer <81818832@qq.com>
|
|
// +----------------------------------------------------------------------
|
|
namespace app\admin\controller;
|
|
|
|
use think\Db;
|
|
use think\Cache;
|
|
use think\helper\Time;
|
|
use app\admin\model\News as NewsModel;
|
|
use app\admin\model\MemberList;
|
|
|
|
class Index extends Base
|
|
{
|
|
/**
|
|
* 后台首页
|
|
*/
|
|
public function index()
|
|
{
|
|
//渲染模板
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 后台多语言切换
|
|
*/
|
|
public function lang()
|
|
{
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else{
|
|
$lang=input('lang_s');
|
|
session('login_http_referer',$_SERVER["HTTP_REFERER"]);
|
|
switch ($lang) {
|
|
case 'cn':
|
|
cookie('think_var', 'zh-cn');
|
|
break;
|
|
case 'en':
|
|
cookie('think_var', 'en-us');
|
|
break;
|
|
//其它语言
|
|
default:
|
|
cookie('think_var', 'zh-cn');
|
|
}
|
|
Cache::clear();
|
|
$this->success('切换成功',session('login_http_referer'));
|
|
}
|
|
}
|
|
}
|