diff --git a/composer.json b/composer.json index 4c4a3b2..1839329 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,8 @@ "license": "MIT", "autoload": { "psr-4": { - "app\\": "src" + "app\\": "src", + "umono\\multiple\\": "extend/yii2-multiple/src" } }, "authors": [ diff --git a/src/config/common.php b/src/config/common.php index 98fd93f..e8834ff 100644 --- a/src/config/common.php +++ b/src/config/common.php @@ -20,9 +20,10 @@ 'bootstrap' => \app\modules\ModulesConfig::bootstrap(), 'aliases' => [ - '@base' => dirname(__DIR__) . '/../', - '@app' => dirname(__DIR__) . '/', - '@app/web' => __DIR__ . '/../../public', + '@base' => dirname(__DIR__) . '/../', + '@app' => dirname(__DIR__) . '/', + '@app/web' => __DIR__ . '/../../public', + '@app/migrations' => __DIR__ . '/../database/migrations', ], "modules" => \app\modules\ModulesConfig::modules(), diff --git a/src/database/migrations/m180601_035116_create_admin_table.php b/src/database/migrations/m180601_035116_create_admin_table.php index 1d12811..efe0fcc 100644 --- a/src/database/migrations/m180601_035116_create_admin_table.php +++ b/src/database/migrations/m180601_035116_create_admin_table.php @@ -1,5 +1,6 @@ $this->string()->defaultValue('')->comment('头像'), 'adminGroupId' => $this->integer()->defaultValue(0)->comment('管理组ID'), 'status' => $this->integer()->notNull()->defaultValue(10)->comment('状态'), - 'created_at' => $this->dateTime()->notNull(), 'created_id' => $this->integer()->notNull()->defaultValue(0)->comment('创建用户'), - 'updated_at' => $this->dateTime()->notNull(), + 'created_at' => $this->dateTime()->notNull()->comment('创建时间'), + 'updated_at' => $this->dateTime()->notNull()->comment('更新时间'), 'updated_id' => $this->integer()->notNull()->defaultValue(0)->comment('修改用户'), 'is_del' => $this->boolean()->defaultValue(false)->comment('是否删除'), 'is_hidden' => $this->boolean()->defaultValue(false)->comment('是否隐藏'), @@ -121,6 +122,13 @@ date('Y-m-d H:i:s'), ], ]); + + // 导入菜单数据 + $this->batchInsert( + $this->adminMenuTableName, + MenuDataHelper::getColumnArr(), + MenuDataHelper::backAll() + ); } /** diff --git a/src/modules/backend/api/controllers/TestController.php b/src/modules/backend/api/controllers/TestController.php index ec0131a..b64e778 100644 --- a/src/modules/backend/api/controllers/TestController.php +++ b/src/modules/backend/api/controllers/TestController.php @@ -3,10 +3,12 @@ namespace app\modules\backend\api\controllers; use app\modules\backend\api\Controller; + use \umono\multiple\helpers\DeleteHelper; class TestController extends Controller { public function actionIndex() { + return DeleteHelper::$bind; } } \ No newline at end of file diff --git a/src/modules/backend/api/helpers/MenuDataHelper.php b/src/modules/backend/api/helpers/MenuDataHelper.php new file mode 100644 index 0000000..0e9ce87 --- /dev/null +++ b/src/modules/backend/api/helpers/MenuDataHelper.php @@ -0,0 +1,65 @@ + $param['id'] ?? -1]); - - if (empty($model)) { - $model->password = $param['password']; - $model->setPassword(); - $model->save(); + if (!empty($model)) { + if (!empty($param['password'])){ + $model->password = $param['password']; + $model->passwordConfirm = true; + $model->save(); + } unset($model); } diff --git a/src/modules/backend/api/models/admin/LoginForm.php b/src/modules/backend/api/models/admin/LoginForm.php index 21cf91a..ef86137 100644 --- a/src/modules/backend/api/models/admin/LoginForm.php +++ b/src/modules/backend/api/models/admin/LoginForm.php @@ -152,12 +152,11 @@ $captchaArr = $this->getCaptchaArr($retryKey); if ($this->captchaCode && !empty($captchaArr['code'] ?? '')) { - if (mb_strtoupper($this->captchaCode) != mb_strtoupper($captchaArr['code'])) { - $this->errMsg = '验证码无效:('; + $this->msgErr('验证码无效:('); } }else{ - $this->errMsg = '请输入验证码:('; + $this->msgErr('请输入验证码:('); } $captcha = new CaptchaBuilder; $captcha->build(); diff --git a/stats.html b/stats.html deleted file mode 100644 index c338cb0..0000000 --- a/stats.html +++ /dev/null @@ -1,4044 +0,0 @@ - - - -
- - - -