This commit is contained in:
umono 2022-12-19 19:07:42 +08:00
parent 91b4392be3
commit 24d4c928c8
10 changed files with 94 additions and 4062 deletions

View File

@ -6,7 +6,8 @@
"license": "MIT", "license": "MIT",
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"app\\": "src" "app\\": "src",
"umono\\multiple\\": "extend/yii2-multiple/src"
} }
}, },
"authors": [ "authors": [

View File

@ -20,9 +20,10 @@
'bootstrap' => \app\modules\ModulesConfig::bootstrap(), 'bootstrap' => \app\modules\ModulesConfig::bootstrap(),
'aliases' => [ 'aliases' => [
'@base' => dirname(__DIR__) . '/../', '@base' => dirname(__DIR__) . '/../',
'@app' => dirname(__DIR__) . '/', '@app' => dirname(__DIR__) . '/',
'@app/web' => __DIR__ . '/../../public', '@app/web' => __DIR__ . '/../../public',
'@app/migrations' => __DIR__ . '/../database/migrations',
], ],
"modules" => \app\modules\ModulesConfig::modules(), "modules" => \app\modules\ModulesConfig::modules(),

View File

@ -1,5 +1,6 @@
<?php <?php
use app\modules\backend\api\helpers\MenuDataHelper;
use yii\db\Migration; use yii\db\Migration;
/** /**
@ -35,9 +36,9 @@
'avatar' => $this->string()->defaultValue('')->comment('头像'), 'avatar' => $this->string()->defaultValue('')->comment('头像'),
'adminGroupId' => $this->integer()->defaultValue(0)->comment('管理组ID'), 'adminGroupId' => $this->integer()->defaultValue(0)->comment('管理组ID'),
'status' => $this->integer()->notNull()->defaultValue(10)->comment('状态'), 'status' => $this->integer()->notNull()->defaultValue(10)->comment('状态'),
'created_at' => $this->dateTime()->notNull(),
'created_id' => $this->integer()->notNull()->defaultValue(0)->comment('创建用户'), '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('修改用户'), 'updated_id' => $this->integer()->notNull()->defaultValue(0)->comment('修改用户'),
'is_del' => $this->boolean()->defaultValue(false)->comment('是否删除'), 'is_del' => $this->boolean()->defaultValue(false)->comment('是否删除'),
'is_hidden' => $this->boolean()->defaultValue(false)->comment('是否隐藏'), 'is_hidden' => $this->boolean()->defaultValue(false)->comment('是否隐藏'),
@ -121,6 +122,13 @@
date('Y-m-d H:i:s'), date('Y-m-d H:i:s'),
], ],
]); ]);
// 导入菜单数据
$this->batchInsert(
$this->adminMenuTableName,
MenuDataHelper::getColumnArr(),
MenuDataHelper::backAll()
);
} }
/** /**

View File

@ -3,10 +3,12 @@
namespace app\modules\backend\api\controllers; namespace app\modules\backend\api\controllers;
use app\modules\backend\api\Controller; use app\modules\backend\api\Controller;
use \umono\multiple\helpers\DeleteHelper;
class TestController extends Controller class TestController extends Controller
{ {
public function actionIndex() public function actionIndex()
{ {
return DeleteHelper::$bind;
} }
} }

View File

@ -0,0 +1,65 @@
<?php
namespace app\modules\backend\api\helpers;
class MenuDataHelper
{
public static function getColumnArr(): array
{
return [
'id',
'name',
'typeName',
'typeDes',
'actionId',
'childrenId',
'sort',
'iconName',
'status',
'created_at',
'updated_at',
];
}
public static function backAll(): array
{
$time = date('Y-m-d H:i:s');
return [
[1, '仪表盘', 0, null, 'home', 0, 1, 'Home24Filled', 1, $time, $time],
[2, '人事管理', 0, null, 'admin', 0, 2, 'PeopleAudience24Filled', 1, $time, $time],
[3, '菜单管理', 0, null, 'menu', 0, 3, 'AppsList24Filled', 1, $time, $time],
[4, '控制台', 1, '一些基本的信息', 'home/index', 1, 1, null, 1, $time, $time],
[5, '员工', 1, '员工的数据页面', 'admin/index', 2, 1, null, 1, $time, $time],
[6, '部门', 1, '部门的数据页面', 'admin-group/index', 2, 2, null, 1, $time, $time],
[7, '操作记录', 1, '后台操作的一些记录', 'admin-log/index', 2, 3, null, 1, $time, $time],
[8, '菜单列表', 1, '菜单的数据页面', 'menu/index', 3, 1, null, 1, $time, $time],
[9, '员工数据查看', 2, '修改更新员工数据', 'admin/view', 5, null, null, 1, $time, $time],
[9, '员工编辑', 2, '修改更新员工数据', 'admin/update', 5, null, null, 1, $time, $time],
[10, '员工创建', 2, '创建员工数据', 'admin/create', 5, null, null, 1, $time, $time],
[11, '员工冻结', 2, '冻结员工账号', 'admin/freeze', 5, null, null, 1, $time, $time],
[12, '修改员工密码', 2, '修改员工密码', 'admin/change-password', 5, null, null, 1, $time, $time],
[13, '员工数据删除', 2, '删除员工数据', 'admin/delete', 5, null, null, 1, $time, $time],
[14, '员工数据导出所选', 2, '导出员工数据', 'admin/export-select', 5, null, null, 1, $time, $time],
[15, '员工数据导出全部', 2, '导出员工数据', 'admin/export', 5, null, null, 1, $time, $time],
[16, '部门数据查看', 2, '部门的数据查看', 'admin-group/view', 6, null, null, 1, $time, $time],
[17, '部门创建', 2, '创建部门数据', 'admin-group/create', 6, null, null, 1, $time, $time],
[18, '部门更新', 2, '更新或修改部门数据', 'admin-group/update', 6, null, null, 1, $time, $time],
[19, '部门删除', 2, '删除部门信息数据', 'admin-group/delete', 6, null, null, 1, $time, $time],
[20, '部门导出所选数据', 2, '导出所选数据', 'admin-group/export-select', 6, null, null, 1, $time, $time],
[21, '部门导出全部数据', 2, '导出全部数据', 'admin-group/export-all', 6, null, null, 1, $time, $time],
[22, '菜单列表创建', 2, '创建菜单数据', 'menu/create', 8, null, null, 1, $time, $time],
[23, '菜单列表编辑', 2, '修改更新菜单数据', 'menu/update', 8, null, null, 1, $time, $time],
[24, '菜单数据删除', 2, '删除菜单数据', 'menu/delete', 8, null, null, 1, $time, $time],
[25, '菜单数据导出所选', 2, '导出所选数据', 'menu/export-select', 8, null, null, 1, $time, $time],
[26, '菜单数据导出全部', 2, '导出全部数据', 'menu/export-all', 8, null, null, 1, $time, $time],
[27, '用户管理', 0, null, 'user', 0, 6, 'People24Filled', 1, $time, $time],
[28, '用户列表', 1, '用户列表数据', 'user/index', 17, 0, null, 1, $time, $time],
];
}
}

View File

@ -87,11 +87,12 @@
public static function updatePassword($param) public static function updatePassword($param)
{ {
$model = Admin::findOne(['id' => $param['id'] ?? -1]); $model = Admin::findOne(['id' => $param['id'] ?? -1]);
if (!empty($model)) {
if (empty($model)) { if (!empty($param['password'])){
$model->password = $param['password']; $model->password = $param['password'];
$model->setPassword(); $model->passwordConfirm = true;
$model->save(); $model->save();
}
unset($model); unset($model);
} }

View File

@ -152,12 +152,11 @@
$captchaArr = $this->getCaptchaArr($retryKey); $captchaArr = $this->getCaptchaArr($retryKey);
if ($this->captchaCode && !empty($captchaArr['code'] ?? '')) { if ($this->captchaCode && !empty($captchaArr['code'] ?? '')) {
if (mb_strtoupper($this->captchaCode) != mb_strtoupper($captchaArr['code'])) { if (mb_strtoupper($this->captchaCode) != mb_strtoupper($captchaArr['code'])) {
$this->errMsg = '验证码无效:('; $this->msgErr('验证码无效:(');
} }
}else{ }else{
$this->errMsg = '请输入验证码:('; $this->msgErr('请输入验证码:(');
} }
$captcha = new CaptchaBuilder; $captcha = new CaptchaBuilder;
$captcha->build(); $captcha->build();

4044
stats.html

File diff suppressed because one or more lines are too long

View File

@ -38,8 +38,9 @@ export default defineComponent({
methods: { methods: {
async show(val: any) { async show(val: any) {
this.isShow = true; this.isShow = true;
this.model = val; this.model.id = val.id;
// do something... this.model.username = val.username;
this.model.password = null;
}, },
async submitFunc() { async submitFunc() {
this.loading = true; this.loading = true;

View File

@ -103,8 +103,6 @@ export default defineComponent({
window.$message.error(data.errMsg); window.$message.error(data.errMsg);
this.captchaImg = data.captchaImg; this.captchaImg = data.captchaImg;
this.captchaCode = ''; this.captchaCode = '';
console.log("????",this.loginForm);
} }
} }
this.loading = false; this.loading = false;