|
@@ -1,5 +1,6 @@
|
|
|
<?php
|
|
|
-declare (strict_types = 1);
|
|
|
+
|
|
|
+declare(strict_types=1);
|
|
|
|
|
|
namespace app\sys\controller;
|
|
|
|
|
@@ -41,10 +42,10 @@ class Index extends Base
|
|
|
private function getIndexTips()
|
|
|
{
|
|
|
$user = $this->getSysUser();
|
|
|
-
|
|
|
+
|
|
|
$defaultPassword = Config::get('app.default_password') ?: 'admin';
|
|
|
|
|
|
- if ($user->password == md5($defaultPassword.$user->salt)) {
|
|
|
+ if ($user->password == md5($defaultPassword . $user->salt)) {
|
|
|
return '<h6 class="mb-0"><i class="icon fas fa-fw fa-exclamation-triangle"></i> 请尽快修改后台初始密码!</h6>';
|
|
|
}
|
|
|
return '';
|
|
@@ -54,10 +55,10 @@ class Index extends Base
|
|
|
{
|
|
|
if ($this->request->isAjax()) {
|
|
|
$dirname = $this->app->getRootPath();
|
|
|
-
|
|
|
+
|
|
|
$dirsize = get_dir_size($dirname);
|
|
|
-
|
|
|
- return ['code'=>0, 'size'=>format_bytes($dirsize)];
|
|
|
+
|
|
|
+ return ['code' => 0, 'size' => format_bytes($dirsize)];
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -65,7 +66,7 @@ class Index extends Base
|
|
|
{
|
|
|
if ($this->request->isAjax()) {
|
|
|
$runtime_path = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR;
|
|
|
-
|
|
|
+
|
|
|
try {
|
|
|
$cache_dir = $runtime_path . 'cache' . DIRECTORY_SEPARATOR;
|
|
|
$admin_dir = $runtime_path . 'admin' . DIRECTORY_SEPARATOR;
|
|
@@ -77,9 +78,30 @@ class Index extends Base
|
|
|
deldir($index_dir);
|
|
|
deldir($api_dir);
|
|
|
} catch (\Exception $e) {
|
|
|
- return ['code'=>0, 'msg'=>$e->getMessage()];
|
|
|
+ return ['code' => 0, 'msg' => $e->getMessage()];
|
|
|
}
|
|
|
- return ['code'=>1, 'msg'=>'清除成功'];
|
|
|
+ return ['code' => 1, 'msg' => '清除成功'];
|
|
|
}
|
|
|
}
|
|
|
+ // 刷新栏目页
|
|
|
+ // public function reClass($classid)
|
|
|
+ // {
|
|
|
+ // $classess = Enewsclass::with('module')->field("classid, bclassid,classname,modid,classpath,islast,islist,listtempid,classurl")->order('classid desc')->select();
|
|
|
+
|
|
|
+ // $publicpath = app()->getRootPath() . 'public/';
|
|
|
+
|
|
|
+ // foreach ($classess as $key => $class) {
|
|
|
+ // if ($class->islast == 1) { // 列表模板, 其他的再说
|
|
|
+ // $model = "\app\common\model\\" . $class->modelName;
|
|
|
+ // $path = $publicpath . $class->classpath;
|
|
|
+ // if (!file_exists($path)) {
|
|
|
+ // mkdir($path, 0755, true);
|
|
|
+ // }
|
|
|
+
|
|
|
+ // $listpage = 25; // 每页25条
|
|
|
+
|
|
|
+ // // $total =
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|