创建版本
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?php namespace Gdoo\Index\Controllers;
|
||||
|
||||
use Gdoo\Index\Services\InfoService;
|
||||
use Request;
|
||||
use Gdoo\Model\Services\ModuleService;
|
||||
|
||||
class IndexController extends DefaultController
|
||||
{
|
||||
/**
|
||||
* 设置可直接访问的方法
|
||||
*/
|
||||
public $permission = [
|
||||
'info',
|
||||
'badge',
|
||||
'badges',
|
||||
'help',
|
||||
'index',
|
||||
'unsupportedBrowser',
|
||||
'support',
|
||||
];
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$user = auth()->user();
|
||||
return $this->render([
|
||||
'user' => $user,
|
||||
]);
|
||||
}
|
||||
|
||||
public function infoAction()
|
||||
{
|
||||
return InfoService::getInfo("abv");
|
||||
}
|
||||
|
||||
// 首页登录指南页面
|
||||
public function helpAction()
|
||||
{
|
||||
return $this->render();
|
||||
}
|
||||
|
||||
// 技术支持
|
||||
public function supportAction()
|
||||
{
|
||||
return $this->render();
|
||||
}
|
||||
|
||||
/*
|
||||
* 通用对话框
|
||||
*/
|
||||
public function dialogAction()
|
||||
{
|
||||
$gets = Request::all();
|
||||
return $this->render([
|
||||
'gets' => $gets
|
||||
]);
|
||||
}
|
||||
|
||||
// 获取单个待办数量
|
||||
public function badgeAction()
|
||||
{
|
||||
$key = Request::input('key');
|
||||
if ($key) {
|
||||
$badge = ModuleService::badges($key);
|
||||
if ($badge) {
|
||||
return response()->json($badge());
|
||||
}
|
||||
}
|
||||
return response()->json(['total' => 0, 'data' => []]);
|
||||
}
|
||||
|
||||
// 获取全部待办数量
|
||||
public function badgesAction()
|
||||
{
|
||||
$badges = ModuleService::badges();
|
||||
$json = [];
|
||||
foreach($badges as $key => $badge) {
|
||||
$json[$key] = $badge();
|
||||
}
|
||||
return response()->json($json);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user