Skip to content

Commit 65e6f38

Browse files
author
pedro
committed
feat:添加日志记录并修复更换密码校验器的bug
1 parent f8b8669 commit 65e6f38

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

app/config/log.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
module.exports = {
4+
log: {
5+
level: 'DEBUG',
6+
dir: 'logs',
7+
sizeLimit: 1024 * 1024 * 5,
8+
requestLog: true
9+
}
10+
};

app/starter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const run = async () => {
2020
const app = await createApp();
2121
const port = config.getItem('port');
2222
app.listen(port, () => {
23-
app.context.logger.start(`listening at http://localhost:${port}`);
23+
app.context.logger.info(`listening at http://localhost:${port}`);
2424
});
2525
};
2626
// 启动应用

app/validators/user.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class ChangePasswordValidator extends LinValidator {
6262
super();
6363
this.new_password = new Rule(
6464
'matches',
65-
'密码长度必须在6~22位之间,包含字符、数字和 _ '
65+
'密码长度必须在6~22位之间,包含字符、数字和 _ ',
66+
/^[A-Za-z0-9_*&$#@]{6,22}$/
6667
);
6768
this.confirm_password = new Rule('isNotEmpty', '确认密码不可为空');
6869
this.old_password = new Rule('isNotEmpty', '请输入旧密码');

0 commit comments

Comments
 (0)