mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-23 02:24:27 +08:00
1. 调整异常处理类
2. 统一职责分工 3. 清除多余代码
This commit is contained in:
84
config/base-config/basic.json
Normal file
84
config/base-config/basic.json
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"formId": "basic-config",
|
||||
"title": "基础设置",
|
||||
"submitText": "保存设置",
|
||||
"submitUrl": "/adminapi/system/base-config/submit/basic",
|
||||
"cacheKey": "basic_config_cache",
|
||||
"refreshAfterSubmit": true,
|
||||
"rules": [
|
||||
{
|
||||
"type": "input",
|
||||
"field": "site_name",
|
||||
"title": "站点名称",
|
||||
"value": "",
|
||||
"props": {
|
||||
"placeholder": "请输入站点名称"
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "站点名称不能为空"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "textarea",
|
||||
"field": "site_description",
|
||||
"title": "站点描述",
|
||||
"value": "",
|
||||
"props": {
|
||||
"placeholder": "请输入站点描述",
|
||||
"autoSize": {
|
||||
"minRows": 3,
|
||||
"maxRows": 6
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"field": "site_logo",
|
||||
"title": "站点Logo",
|
||||
"value": "",
|
||||
"props": {
|
||||
"placeholder": "请输入Logo地址或上传Logo"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"field": "icp_number",
|
||||
"title": "备案号",
|
||||
"value": "",
|
||||
"props": {
|
||||
"placeholder": "请输入ICP备案号"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "switch",
|
||||
"field": "site_status",
|
||||
"title": "站点状态",
|
||||
"value": true,
|
||||
"props": {
|
||||
"checkedText": "开启",
|
||||
"uncheckedText": "关闭"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "inputNumber",
|
||||
"field": "page_size",
|
||||
"title": "每页显示数量",
|
||||
"value": 10,
|
||||
"props": {
|
||||
"min": 1,
|
||||
"max": 100,
|
||||
"precision": 0
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "每页显示数量不能为空"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
112
config/base-config/email.json
Normal file
112
config/base-config/email.json
Normal file
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"formId": "email-config",
|
||||
"title": "邮件设置",
|
||||
"submitText": "保存设置",
|
||||
"submitUrl": "/adminapi/system/base-config/submit/email",
|
||||
"cacheKey": "email_config_cache",
|
||||
"refreshAfterSubmit": true,
|
||||
"rules": [
|
||||
{
|
||||
"type": "input",
|
||||
"field": "smtp_host",
|
||||
"title": "SMTP服务器",
|
||||
"value": "",
|
||||
"props": {
|
||||
"placeholder": "例如:smtp.qq.com"
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "SMTP服务器不能为空"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "inputNumber",
|
||||
"field": "smtp_port",
|
||||
"title": "SMTP端口",
|
||||
"value": 465,
|
||||
"props": {
|
||||
"min": 1,
|
||||
"max": 65535,
|
||||
"precision": 0
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "SMTP端口不能为空"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "switch",
|
||||
"field": "smtp_ssl",
|
||||
"title": "启用SSL",
|
||||
"value": true,
|
||||
"props": {
|
||||
"checkedText": "是",
|
||||
"uncheckedText": "否"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"field": "smtp_username",
|
||||
"title": "SMTP用户名",
|
||||
"value": "",
|
||||
"props": {
|
||||
"placeholder": "请输入SMTP用户名"
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "SMTP用户名不能为空"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"field": "smtp_password",
|
||||
"title": "SMTP密码",
|
||||
"value": "",
|
||||
"props": {
|
||||
"type": "password",
|
||||
"placeholder": "请输入SMTP密码或授权码"
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "SMTP密码不能为空"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"field": "from_email",
|
||||
"title": "发件人邮箱",
|
||||
"value": "",
|
||||
"props": {
|
||||
"placeholder": "请输入发件人邮箱地址"
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "发件人邮箱不能为空"
|
||||
},
|
||||
{
|
||||
"type": "email",
|
||||
"message": "请输入正确的邮箱地址"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"field": "from_name",
|
||||
"title": "发件人名称",
|
||||
"value": "",
|
||||
"props": {
|
||||
"placeholder": "请输入发件人名称"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
99
config/base-config/permission.json
Normal file
99
config/base-config/permission.json
Normal file
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"formId": "permission-config",
|
||||
"title": "权限设置",
|
||||
"submitText": "保存设置",
|
||||
"submitUrl": "/adminapi/system/base-config/submit/permission",
|
||||
"cacheKey": "permission_config_cache",
|
||||
"refreshAfterSubmit": true,
|
||||
"rules": [
|
||||
{
|
||||
"type": "switch",
|
||||
"field": "enable_permission",
|
||||
"title": "启用权限控制",
|
||||
"value": true,
|
||||
"props": {
|
||||
"checkedText": "启用",
|
||||
"uncheckedText": "禁用"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "inputNumber",
|
||||
"field": "session_timeout",
|
||||
"title": "会话超时时间(分钟)",
|
||||
"value": 30,
|
||||
"props": {
|
||||
"min": 1,
|
||||
"max": 1440,
|
||||
"precision": 0
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "会话超时时间不能为空"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "inputNumber",
|
||||
"field": "password_min_length",
|
||||
"title": "密码最小长度",
|
||||
"value": 6,
|
||||
"props": {
|
||||
"min": 4,
|
||||
"max": 32,
|
||||
"precision": 0
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "密码最小长度不能为空"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "switch",
|
||||
"field": "require_strong_password",
|
||||
"title": "要求强密码",
|
||||
"value": false,
|
||||
"props": {
|
||||
"checkedText": "是",
|
||||
"uncheckedText": "否"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "inputNumber",
|
||||
"field": "max_login_attempts",
|
||||
"title": "最大登录尝试次数",
|
||||
"value": 5,
|
||||
"props": {
|
||||
"min": 1,
|
||||
"max": 10,
|
||||
"precision": 0
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "最大登录尝试次数不能为空"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "inputNumber",
|
||||
"field": "lockout_duration",
|
||||
"title": "账户锁定时长(分钟)",
|
||||
"value": 30,
|
||||
"props": {
|
||||
"min": 1,
|
||||
"max": 1440,
|
||||
"precision": 0
|
||||
},
|
||||
"validate": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "账户锁定时长不能为空"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
27
config/base-config/tabs.json
Normal file
27
config/base-config/tabs.json
Normal file
@@ -0,0 +1,27 @@
|
||||
[
|
||||
{
|
||||
"key": "basic",
|
||||
"title": "基础设置",
|
||||
"icon": "settings",
|
||||
"description": "配置系统基础信息,包括站点名称、Logo、备案号等",
|
||||
"sort": 1,
|
||||
"disabled": false
|
||||
},
|
||||
{
|
||||
"key": "email",
|
||||
"title": "邮件设置",
|
||||
"icon": "email",
|
||||
"description": "配置邮件服务器相关参数,包括SMTP服务器、端口、账号密码等",
|
||||
"sort": 2,
|
||||
"disabled": false
|
||||
},
|
||||
{
|
||||
"key": "permission",
|
||||
"title": "权限设置",
|
||||
"icon": "lock",
|
||||
"description": "配置系统权限相关参数,预留权限控制功能",
|
||||
"sort": 3,
|
||||
"disabled": false
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 字典数据配置
|
||||
*/
|
||||
return [
|
||||
[
|
||||
'name' => '性别',
|
||||
'code' => 'gender',
|
||||
'description' => '这是一个性别字典',
|
||||
'list' => [
|
||||
['name' => '女', 'value' => 0],
|
||||
['name' => '男', 'value' => 1],
|
||||
['name' => '其它', 'value' => 2],
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => '状态',
|
||||
'code' => 'status',
|
||||
'description' => '状态字段可以用这个',
|
||||
'list' => [
|
||||
['name' => '禁用', 'value' => 0],
|
||||
['name' => '启用', 'value' => 1],
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => '岗位',
|
||||
'code' => 'post',
|
||||
'description' => '岗位字段',
|
||||
'list' => [
|
||||
['name' => '总经理', 'value' => 1],
|
||||
['name' => '总监', 'value' => 2],
|
||||
['name' => '人事主管', 'value' => 3],
|
||||
['name' => '开发部主管', 'value' => 4],
|
||||
['name' => '普通职员', 'value' => 5],
|
||||
['name' => '其它', 'value' => 999],
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => '任务状态',
|
||||
'code' => 'taskStatus',
|
||||
'description' => '任务状态字段可以用它',
|
||||
'list' => [
|
||||
['name' => '失败', 'value' => 0],
|
||||
['name' => '成功', 'value' => 1],
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
// 系统配置更新后重新加载缓存
|
||||
'system.config.updated' => [
|
||||
[app\events\SystemConfig::class, 'reload'],
|
||||
],
|
||||
];
|
||||
|
||||
8
config/plugin/webman/validation/app.php
Normal file
8
config/plugin/webman/validation/app.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
use support\validation\ValidationException;
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
'exception' => ValidationException::class,
|
||||
];
|
||||
7
config/plugin/webman/validation/command.php
Normal file
7
config/plugin/webman/validation/command.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Webman\Validation\Command\MakeValidatorCommand;
|
||||
|
||||
return [
|
||||
MakeValidatorCommand::class
|
||||
];
|
||||
9
config/plugin/webman/validation/middleware.php
Normal file
9
config/plugin/webman/validation/middleware.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Webman\Validation\Middleware;
|
||||
|
||||
return [
|
||||
'@' => [
|
||||
Middleware::class,
|
||||
],
|
||||
];
|
||||
45
config/system-file/dict.json
Normal file
45
config/system-file/dict.json
Normal file
@@ -0,0 +1,45 @@
|
||||
[
|
||||
{
|
||||
"name": "性别",
|
||||
"code": "gender",
|
||||
"description": "这是一个性别字典",
|
||||
"list": [
|
||||
{ "name": "女", "value": 0 },
|
||||
{ "name": "男", "value": 1 },
|
||||
{ "name": "其它", "value": 2 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "状态",
|
||||
"code": "status",
|
||||
"description": "状态字段可以用这个",
|
||||
"list": [
|
||||
{ "name": "禁用", "value": 0 },
|
||||
{ "name": "启用", "value": 1 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "岗位",
|
||||
"code": "post",
|
||||
"description": "岗位字段",
|
||||
"list": [
|
||||
{ "name": "总经理", "value": 1 },
|
||||
{ "name": "总监", "value": 2 },
|
||||
{ "name": "人事主管", "value": 3 },
|
||||
{ "name": "开发部主管", "value": 4 },
|
||||
{ "name": "普通职员", "value": 5 },
|
||||
{ "name": "其它", "value": 999 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "任务状态",
|
||||
"code": "taskStatus",
|
||||
"description": "任务状态字段可以用它",
|
||||
"list": [
|
||||
{ "name": "失败", "value": 0 },
|
||||
{ "name": "成功", "value": 1 }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
1059
config/system-file/menu.json
Normal file
1059
config/system-file/menu.json
Normal file
File diff suppressed because it is too large
Load Diff
137
config/system-file/menu.md
Normal file
137
config/system-file/menu.md
Normal file
@@ -0,0 +1,137 @@
|
||||
# 系统菜单配置
|
||||
|
||||
## 配置说明
|
||||
系统菜单基于路由配置实现,以下是完整的菜单路由配置项说明,所有配置项均为 JSON 格式,可直接用于前端路由解析。
|
||||
|
||||
## 核心配置结构
|
||||
```json
|
||||
{
|
||||
"id": "01",
|
||||
"parentId": "0",
|
||||
"path": "/home",
|
||||
"name": "home",
|
||||
"component": "home/home",
|
||||
"meta": {
|
||||
"title": "home",
|
||||
"hide": false,
|
||||
"disable": false,
|
||||
"keepAlive": false,
|
||||
"affix": true,
|
||||
"link": "",
|
||||
"iframe": false,
|
||||
"isFull": false,
|
||||
"roles": ["admin", "common"],
|
||||
"svgIcon": "home",
|
||||
"icon": "",
|
||||
"sort": 1,
|
||||
"type": 2
|
||||
},
|
||||
"children": null
|
||||
}
|
||||
```
|
||||
|
||||
## 字段详细说明
|
||||
| 一级字段 | 类型 | 必填 | 说明 |
|
||||
|----------|--------|------|----------------------------------------------------------------------|
|
||||
| `id` | string | 是 | 路由唯一标识,建议按「层级+序号」命名(如 01=首页,0201=订单管理)|
|
||||
| `parentId` | string | 是 | 父路由ID,顶层路由固定为 `0`,子路由对应父路由的 `id` |
|
||||
| `path` | string | 是 | 路由访问路径(如 `/home`、`/order/order-list`)|
|
||||
| `name` | string | 是 | 路由名称,需与组件名/路径名保持一致,用于路由跳转标识 |
|
||||
| `component` | string | 否 | 组件文件路径(基于 `src/views` 目录),如 `home/home` 对应 `src/views/home/home.vue`;目录级路由可省略 |
|
||||
| `meta` | object | 是 | 路由元信息,包含菜单展示、权限、样式等核心配置 |
|
||||
| `children` | array | 否 | 子路由列表,目录级路由(`type:1`)需配置,菜单级路由(`type:2`)默认为 `null` |
|
||||
|
||||
### `meta` 子字段说明
|
||||
| 子字段 | 类型 | 必填 | 默认值 | 说明 |
|
||||
|-----------|---------|------|--------|----------------------------------------------------------------------|
|
||||
| `title` | string | 是 | - | 菜单显示标题:<br>1. 填写国际化key(如 `home`),自动匹配多语言;<br>2. 无对应key则直接展示文字 |
|
||||
| `hide` | boolean | 否 | false | 是否隐藏菜单:<br>✅ true = 不显示在侧边栏,但可正常访问;<br>❌ false = 正常显示 |
|
||||
| `disable` | boolean | 否 | false | 是否停用路由:<br>✅ true = 不显示+不可访问;<br>❌ false = 正常可用 |
|
||||
| `keepAlive` | boolean | 否 | false | 是否缓存组件:<br>✅ true = 切换路由不销毁组件;<br>❌ false = 切换后销毁 |
|
||||
| `affix` | boolean | 否 | false | 是否固定在标签栏:<br>✅ true = 标签栏无关闭按钮;<br>❌ false = 可关闭 |
|
||||
| `link` | string | 否 | "" | 外链地址,填写后路由跳转至该地址(优先级高于 `component`)|
|
||||
| `iframe` | boolean | 否 | false | 是否内嵌外链:<br>✅ true = 在页面内以iframe展示 `link` 地址;<br>❌ false = 跳转新页面 |
|
||||
| `isFull` | boolean | 否 | false | 是否全屏显示:<br>✅ true = 菜单页面占满整个视口;<br>❌ false = 保留侧边栏/头部 |
|
||||
| `roles` | array | 否 | [] | 路由权限角色:<br>如 `["admin", "common"]`,仅对应角色可访问该菜单 |
|
||||
| `svgIcon` | string | 否 | "" | SVG菜单图标:<br>优先级高于 `icon`,取值为 `src/assets/svgs` 目录下的SVG文件名 |
|
||||
| `icon` | string | 否 | "" | 普通图标:<br>默认使用 Arco Design 图标库,填写图标名(如 `icon-file`)即可 |
|
||||
| `sort` | number | 否 | 0 | 菜单排序:数值越小,展示越靠前 |
|
||||
| `type` | number | 是 | - | 路由类型:<br>1 = 目录(仅作为父级,无组件);<br>2 = 菜单(可访问的页面);<br>3 = 按钮(权限控制用) |
|
||||
|
||||
## 配置示例
|
||||
### 1. 顶层菜单(首页)
|
||||
```json
|
||||
{
|
||||
"id": "01",
|
||||
"parentId": "0",
|
||||
"path": "/home",
|
||||
"name": "home",
|
||||
"component": "home/home",
|
||||
"meta": {
|
||||
"title": "平台首页",
|
||||
"hide": false,
|
||||
"disable": false,
|
||||
"keepAlive": false,
|
||||
"affix": true,
|
||||
"link": "",
|
||||
"iframe": false,
|
||||
"isFull": false,
|
||||
"roles": ["admin", "common"],
|
||||
"svgIcon": "home",
|
||||
"icon": "",
|
||||
"sort": 1,
|
||||
"type": 2
|
||||
},
|
||||
"children": null
|
||||
}
|
||||
```
|
||||
|
||||
### 2. 目录级路由(收款订单)
|
||||
```json
|
||||
{
|
||||
"id": "02",
|
||||
"parentId": "0",
|
||||
"path": "/order",
|
||||
"name": "order",
|
||||
"redirect": "/order/order-list",
|
||||
"meta": {
|
||||
"title": "收款订单",
|
||||
"hide": false,
|
||||
"disable": false,
|
||||
"keepAlive": true,
|
||||
"affix": false,
|
||||
"link": "",
|
||||
"iframe": false,
|
||||
"isFull": false,
|
||||
"roles": ["admin", "common"],
|
||||
"svgIcon": "order",
|
||||
"icon": "",
|
||||
"sort": 2,
|
||||
"type": 1
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"id": "0201",
|
||||
"parentId": "02",
|
||||
"path": "/order/order-list",
|
||||
"name": "order-list",
|
||||
"component": "order/order-list/index",
|
||||
"meta": {
|
||||
"title": "订单管理",
|
||||
"hide": false,
|
||||
"disable": false,
|
||||
"keepAlive": true,
|
||||
"affix": false,
|
||||
"link": "",
|
||||
"iframe": false,
|
||||
"isFull": false,
|
||||
"roles": ["admin", "common"],
|
||||
"icon": "icon-file",
|
||||
"sort": 1,
|
||||
"type": 2
|
||||
},
|
||||
"children": null
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user