@befly-addon/admin 1.0.22 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,10 +5,16 @@
5
5
  import { Yes, No } from 'befly';
6
6
 
7
7
  export default {
8
- name: '保存管理员角色',
8
+ name: '管理员角色保存',
9
9
  fields: {
10
- adminId: '@id',
11
- roleCode: '角色编码|string|2|50|null|1|^[a-zA-Z0-9_]+$'
10
+ adminId: Fields._id,
11
+ roleCode: {
12
+ name: '角色编码',
13
+ type: 'string',
14
+ min: 2,
15
+ max: 50,
16
+ regexp: '^[a-zA-Z0-9_]+$'
17
+ }
12
18
  },
13
19
  handler: async (befly, ctx) => {
14
20
  // 查询角色是否存在(使用 roleCode 而非 roleId)
@@ -9,7 +9,12 @@ export default {
9
9
  name: '管理员登录',
10
10
  auth: false,
11
11
  fields: {
12
- account: '账号|string|3|100|null|1|null',
12
+ account: {
13
+ name: '账号',
14
+ type: 'string',
15
+ min: 3,
16
+ max: 100
17
+ },
13
18
  password: adminTable.password
14
19
  },
15
20
  required: ['account', 'password'],
package/apis/role/save.ts CHANGED
@@ -5,9 +5,15 @@
5
5
  import { Yes, No } from 'befly';
6
6
 
7
7
  export default {
8
- name: '保存用户角色',
8
+ name: '角色保存',
9
9
  fields: {
10
- roleCode: '角色编码|string|2|50|null|1|^[a-zA-Z0-9_]+$'
10
+ roleCode: {
11
+ name: '角色编码',
12
+ type: 'string',
13
+ min: 2,
14
+ max: 50,
15
+ regexp: '^[a-zA-Z0-9_]+$'
16
+ }
11
17
  },
12
18
  handler: async (befly, ctx) => {
13
19
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@befly-addon/admin",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Befly - 管理后台功能组件",
5
5
  "type": "module",
6
6
  "private": false,
@@ -39,8 +39,8 @@
39
39
  "url": "https://github.com/chenbimo/befly.git",
40
40
  "directory": "packages/addon-admin"
41
41
  },
42
- "gitHead": "6a88545c6f29fbf97094d4e735875a362ee5cad8",
42
+ "gitHead": "f3f4db9f70580b0103c9dab3891c816ed6b03135",
43
43
  "dependencies": {
44
- "befly": "3.8.11"
44
+ "befly": "3.8.12"
45
45
  }
46
46
  }