66 lines
3.2 KiB
PHP
66 lines
3.2 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
|
// +----------------------------------------------------------------------
|
|
namespace app\controller;
|
|
|
|
use think\facade\Console;
|
|
use app\controller\Base;
|
|
use Dcat\EasyExcel\Excel;
|
|
use app\services\FieldService;
|
|
|
|
/**
|
|
* @title 首页
|
|
*/
|
|
class Index extends Base{
|
|
|
|
/**
|
|
* @title 首页
|
|
*
|
|
* @return void
|
|
*/
|
|
public function index(){
|
|
if(request()->isAjax()){
|
|
return ['code' => 1, 'data' => 'SentOS'];
|
|
}else{
|
|
return view(`<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible"content="IE=edge"><meta name="viewport"content="width=device-width, initial-scale=1"><title>SentOS</title><style>html,body{background-color:#fff;color:#3c4042;font-family:'Raleway',sans-serif;font-weight:100;height:80vh;margin:0}.top{text-align:right;line-height:35px;padding:0 20px}.top a{color:#333333;padding:0 10px}.full-height{height:90vh}.flex-center{align-items:center;display:flex;justify-content:center}.position-ref{position:relative}.top-right{position:absolute;right:10px;top:18px}.content{text-align:center}.title{font-size:84px}.links>a{color:#3c4042;padding:0 25px;font-size:12px;font-weight:600;letter-spacing:.1rem;text-decoration:none;text-transform:uppercase}.m-b-md{margin-bottom:30px}</style></head><body><div class="flex-center position-ref full-height"><div class="content"><div class="title m-b-md">SentOS</div><div class="links"></div></div></div><div style="text-align: center; font-size: 12px;"><p><a href="https://beian.miit.gov.cn/"target="_blank"style="color: #333333; text-decoration: none;">赣ICP备13006622号-1</a></p><p>技术支持:<a href="https://www.tensent.cn"target="_blank"style="color: #333333; text-decoration: none;">腾速科技</a></p></div></body></html>`);
|
|
}
|
|
}
|
|
|
|
public function test(){
|
|
// $output = Console::call('worker:gateway');
|
|
$service = app()->make(\app\services\wechat\OauthService::class);
|
|
print_r($service->getQrCode($this->request)) ;
|
|
// return $output->fetch();
|
|
// $array = [
|
|
// ['id' => 1, 'name' => 'Brakus', 'email' => 'treutel@eg.com', 'created_at' => '...'],
|
|
// ];
|
|
// Excel::export($array)->download('users.xlsx');
|
|
// $area = \think\facade\Db::name('areas')->select();
|
|
// $save = [];
|
|
// foreach($area as $val){
|
|
// $save[] = ['title' => $val['area'], 'code' => $val['area_id'], 'parent_id' => $val['city_id'], 'first' => '', 'create_time' => time(), 'update_time' => time()];
|
|
// }
|
|
// \think\facade\Db::name('area')->insertAll($save);
|
|
}
|
|
|
|
/**
|
|
* @title 导出模版
|
|
*
|
|
* @return void
|
|
*/
|
|
public function template(FieldService $service){
|
|
$model = $this->request->param('model');
|
|
$array = [];
|
|
$headings = array_flip($service->getFields($model));
|
|
return Excel::export($array)->headings($headings)->download($model . time() . '.xlsx');
|
|
}
|
|
|
|
public function miss(){
|
|
return '404 Not Found!';
|
|
}
|
|
} |