Skip to content

Commit b3747ae

Browse files
authored
Merge pull request #86 from TaleLin/perf/update-user
perf(*): 编辑用户至少选择一个分组
2 parents 6ad3e71 + ce70013 commit b3747ae

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Lin-CMS 是林间有风团队经过大量项目实践所提炼出的一套**内
3333

3434
### 当前最新版本
3535

36-
lin-cms-koa(当前示例工程):0.3.6
36+
lin-cms-koa(当前示例工程):0.3.7
3737

3838
lin-mizar(核心库) :0.3.5
3939

@@ -63,7 +63,11 @@ QQ 群号:643205479 / 814597236
6363

6464
## 版本日志
6565

66-
最新版本 `0.3.6`
66+
最新版本 `0.3.7`
67+
68+
### 0.3.7
69+
70+
1. `U` 优化 编辑用户至少选择一个分组
6771

6872
### 0.3.6
6973

app/api/v1/book.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import { getSafeParamId } from '../../lib/util';
1010
import { BookNotFound } from '../../lib/exception';
1111
import { BookDao } from '../../dao/book';
1212

13-
console.log(disableLoading)
14-
1513
// book 的红图实例
1614
const bookApi = new LinRouter({
1715
prefix: '/v1/book',

app/validator/admin.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AdminUsersValidator extends PaginateValidator {
1414
}
1515

1616
class ResetPasswordValidator extends PositiveIdValidator {
17-
constructor () {
17+
constructor () {
1818
super();
1919
this.new_password = new Rule(
2020
'matches',
@@ -40,11 +40,8 @@ class ResetPasswordValidator extends PositiveIdValidator {
4040
class UpdateUserInfoValidator extends PositiveIdValidator {
4141
validateGroupIds (data) {
4242
const ids = data.body.group_ids;
43-
if (isOptional(ids)) {
44-
return true;
45-
}
46-
if (!Array.isArray(ids)) {
47-
return [false, '每个id值必须为正整数'];
43+
if (!Array.isArray(ids) || ids.length < 1) {
44+
return [false, '至少选择一个分组'];
4845
}
4946
for (let id of ids) {
5047
if (typeof id === 'number') {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lin-cms-koa",
3-
"version": "0.3.6",
3+
"version": "0.3.7",
44
"description": "simple and practical CMS implememted by koa",
55
"main": "app/starter.js",
66
"scripts": {

0 commit comments

Comments
 (0)