Skip to content

Commit

Permalink
Merge pull request #51 from muction/v2022.1.14
Browse files Browse the repository at this point in the history
V2022.1.14
  • Loading branch information
muction authored Jan 14, 2022
2 parents ed5a8f3 + 7958f36 commit d8c46c4
Show file tree
Hide file tree
Showing 21 changed files with 88 additions and 131 deletions.
Binary file added Src/Asset/stars/images/login_bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions Src/Console/Commands/AppPack.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/**
* 为了上线后部署及更新方便,开发了更新打包命令
*
* 1、php artisan app:pack [file1,file2,file3....] | [git:commitId]
* 2、php artisan app:pack
* 1、php artisan stars:app_pack [file1,file2,file3....] | [git:commitId]
* 2、php artisan stars:app_pack
*
* 所有打包操作都是以 appPath 为根基地址操作的
*
Expand All @@ -24,7 +24,7 @@ class AppPack extends AbstractAppPatch
*
* @var string
*/
protected $signature = 'app:pack';
protected $signature = 'stars:app_pack';

/**
* The console command description.
Expand Down Expand Up @@ -107,10 +107,10 @@ public function working()

/**
* 给到一些文件进行zip打包
* @param array $files
* @return bool
*/
private function packZipFiles( ){
private function packZipFiles( ): bool
{

try{
$files = "";
Expand Down
2 changes: 1 addition & 1 deletion Src/Console/Commands/AppUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AppUpdate extends AbstractAppPatch
*
* @var string
*/
protected $signature = 'app:update {patchFile}';
protected $signature = 'stars:app_update {patchFile}';

/**
* The console command description.
Expand Down
17 changes: 10 additions & 7 deletions Src/Console/Commands/EntityMake.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@
namespace Stars\Peace\Console\Commands;


use Exception;
use Illuminate\Contracts\Filesystem\FileNotFoundException;

class EntityMake extends PeacePeace
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'make:entity {entityName}';
protected $signature = 'stars:make_entity {entityName}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Create a new stars core entity file for private';
protected $description = '创建一个Stars实体模型文件';

/**
* 定义参数名称
Expand All @@ -39,9 +42,9 @@ class EntityMake extends PeacePeace
/**
* Execute the console command.
*
* @return mixed
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
* @throws \Exception
* @return void
* @throws FileNotFoundException
* @throws Exception
*/
public function handleCommand()
{
Expand All @@ -51,8 +54,8 @@ public function handleCommand()

/**
* 替换模板内容
* @return mixed
* @throws \Exception
* @return array|string|string[]
* @throws Exception
*/
protected function replaceStubContent()
{
Expand Down
17 changes: 10 additions & 7 deletions Src/Console/Commands/ServiceMake.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@
namespace Stars\Peace\Console\Commands;


use Exception;
use Illuminate\Contracts\Filesystem\FileNotFoundException;

class ServiceMake extends PeacePeace
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'make:service {entityName}';
protected $signature = 'stars:make_service {entityName}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Create a new stars core service file for private';
protected $description = '创建一个Stars 服务文件';

/**
* 定义参数名称
Expand All @@ -39,9 +42,9 @@ class ServiceMake extends PeacePeace
/**
* Execute the console command.
*
* @return mixed
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
* @throws \Exception
* @return void
* @throws FileNotFoundException
* @throws Exception
*/
public function handleCommand()
{
Expand All @@ -51,8 +54,8 @@ public function handleCommand()

/**
* 替换模板内容
* @return mixed
* @throws \Exception
* @return array|string|string[]
* @throws Exception
*/
protected function replaceStubContent()
{
Expand Down
4 changes: 2 additions & 2 deletions Src/Console/Commands/SheetInit.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class SheetInit extends PeacePeace
*
* @var string
*/
protected $signature = 'sheet:init {entityName} {isCore?}';
protected $signature = 'stars:init_sheet {entityName} {isCore?}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Initialize a Sheet File';
protected $description = '初始化一个 sheet模板配置';

/**
* 定义参数名称
Expand Down
4 changes: 2 additions & 2 deletions Src/Console/Commands/SheetMake.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class SheetMake extends PeacePeace
*
* @var string
*/
protected $signature = 'make:sheet {entityName} {isCore?}';
protected $signature = 'stars:make_sheet {entityName} {isCore?}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Create a new stars sheet file';
protected $description = '创建一个新的Sheet配置模板';

/**
* 定义参数名称
Expand Down
18 changes: 9 additions & 9 deletions Src/Console/Commands/StarsForge.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Stars\Peace\Console\Commands;

use Exception;
use Illuminate\Support\Facades\DB;
use Stars\Peace\Entity\ArticleEntity;
use Stars\Peace\Foundation\SheetSheet;
Expand All @@ -22,14 +23,14 @@ class StarsForge extends PeacePeace
*
* @var string
*/
protected $signature = 'Stars:forge';
protected $signature = 'stars:forge';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Stars forge some test datas';
protected $description = '给 stars系统绑定模生成测试数据';

/**
* 定义参数名称
Expand Down Expand Up @@ -62,9 +63,8 @@ class StarsForge extends PeacePeace
/**
* Execute the console command.
*
* @return mixed
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
* @throws \Exception
* @return false|void
* @throws Exception
*/
public function handleCommand()
{
Expand Down Expand Up @@ -123,7 +123,7 @@ public function handleCommand()
/**
* 替换模板内容
* @return mixed
* @throws \Exception
* @throws Exception
*/
protected function replaceStubContent()
{
Expand Down Expand Up @@ -248,13 +248,13 @@ private function makeForgeData( $menuId, $bindId ){
$menuBindService = new MenuBindService() ;
$bindInfo = $menuBindService->bindInfo( $menuId, $bindId ) ;
if(!$bindInfo){
throw new \Exception( "绑定信息没有找到" );
throw new Exception( "绑定信息没有找到" );
}

$sheetService = new SheetService();
$sheetInfo = $sheetService->info( $bindInfo['sheet_name'] );
if(!$sheetInfo){
throw new \Exception( 'sheet信息没有找到');
throw new Exception( 'sheet信息没有找到');
}

$sheetInfo = $sheetInfo->detail();
Expand Down Expand Up @@ -311,7 +311,7 @@ private function makeForgeData( $menuId, $bindId ){

return true;

}catch (\Exception $exception){
}catch (Exception $exception){

return $exception->getMessage() ;
}
Expand Down
4 changes: 2 additions & 2 deletions Src/Console/Commands/StarsInit.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class StarsInit extends PeacePeace
*
* @var string
*/
protected $signature = 'Stars:init';
protected $signature = 'stars:init';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Initialize Stars System';
protected $description = '初始化Stars系统';

/**
* 超级管理员登录名
Expand Down
4 changes: 2 additions & 2 deletions Src/Console/Commands/StarsVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class StarsVersion extends PeacePeace
*
* @var string
*/
protected $signature = 'Stars:version';
protected $signature = 'stars:version';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Get system version';
protected $description = '获取系统版本号';

/**
* 超级管理员登录名
Expand Down
20 changes: 8 additions & 12 deletions Src/Controller/Auth/AuthController.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php
namespace Stars\Peace\Controller\Auth;

use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\ValidationException;
use Stars\Peace\Controller\PeaceController;
use Stars\Peace\Service\AuthService;
use Stars\Rbac\Entity\UserEntity;
Expand All @@ -20,34 +23,27 @@ public function login(){
* 登录系统
* @param Request $request
* @param AuthService $authService
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \Illuminate\Validation\ValidationException
* @return RedirectResponse|Redirector
* @throws ValidationException
*/
public function loginHandle(Request $request, AuthService $authService){
$this->validate($request, [
'username' => 'required',
'password' => 'required',
'captcha' => 'required|captcha',
],[
'captcha.required' => trans('validation.required'),
'captcha.captcha' => trans('validation.captcha'),
]);
] ,['validation.captcha' =>'验证码错误']);

$result = $authService->login(
$request->post('username') ,
$request->post('password')
);

if(!$result){
return redirect( route('rotate.auth.login.page') )->withErrors( ['errorMessage'=>'账号密码错误']);
}

return redirect( route('rotate.home.index') );
return $result ? redirect( route('rotate.home.index') ) : back()->withErrors(['error'=>'登录失败']);
}

/**
* 退出系统
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @return RedirectResponse|Redirector
*/
public function logout(){

Expand Down
43 changes: 1 addition & 42 deletions Src/Views/Bamboo/dashboard/simple.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,6 @@

@section('car-body')

<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<h4>系统概览</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<colgroup>
<col width="13%"/>
<col width="37%"/>
<col width="13%"/>
<col width="37%"/>
</colgroup>

<tbody>

<tr>
<td>系统账号</td>
<td>{{ $adminTotal }} 个</td>
</tr>

<tr>
<td>附件数量</td>
<td>{{ $attachmentTotal }} 个</td>
</tr>
<tr>
<td>工作目录</td>
<td>{{ request()->server('DOCUMENT_ROOT') }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>

</div>


<div class="row">
<div class="col-lg-12">
<div class="card">
Expand Down Expand Up @@ -85,7 +44,7 @@

<tr>
<td>服务器IP</td>
<td>{{ Sysinfo::ip() }}</td>
<td> *** </td>
<td>最大上传文件大小</td>
<td>{{ Sysinfo::upload_max_filesize() }}</td>
</tr>
Expand Down
Loading

0 comments on commit d8c46c4

Please sign in to comment.