free-be-account 0.0.35 → 0.0.37

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.
package/index.js CHANGED
@@ -1170,7 +1170,7 @@ module.exports = (app) => ({
1170
1170
  if (res._headerSent) return;
1171
1171
 
1172
1172
  // check captcha
1173
- if(m.config.captcha.login && !((req.body.password === 'wx' || req.body.password.startsWith('wx:')) && req.body.username.startsWith('wx:'))) {
1173
+ if(m.config.captcha.login && !res.locals.__ignore_login_captcha && !((req.body.password === 'wx' || req.body.password.startsWith('wx:')) && req.body.username.startsWith('wx:'))) {
1174
1174
  const { captcha, id : cid } = req.body.captcha || {};
1175
1175
  if (!captcha || !cid) {
1176
1176
  res.makeError(400, 'Please provide captcha code!', m);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-be-account",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "main": "index.js",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -60,23 +60,16 @@ router.put('/read/:id',
60
60
 
61
61
  // read all
62
62
  router.put('/read',
63
- (req, res, next) => {
64
- res.locals.filter = {
63
+ async (req, res, next) => {
64
+ await res.app.models.system_notification.updateMany({
65
65
  User: req.user.id,
66
66
  Read: false,
67
- };
68
-
69
- res.locals.fields = [
70
- 'Read',
71
- ]
72
-
73
- res.locals.body = {
67
+ }, {
74
68
  Read: true,
75
- };
69
+ });
76
70
 
77
71
  return next();
78
72
  },
79
- router.UpdateDocuments('system_notification'),
80
73
  );
81
74
 
82
75
  router.delete('/:id',