liuyu %!s(int64=5) %!d(string=hai) anos
pai
achega
b9c20b7c2e
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/service/login.js

+ 2 - 2
app/service/login.js

@@ -38,10 +38,10 @@ class LoginService extends CrudService {
     for (const elm of user.menus) {
       const _menu = await this.rmodel.findById({ _id: ObjectId(elm) });
       if (_menu) {
-        _menus.push(_menu);
+        _menus.push({ id: elm, role_name: _menu.role_name, url: _menu.url });
       }
     }
-    user.menus = _menus;
+    user.menus = JSON.stringify(_menus);
     const token = await this.createJwt(user);
     await this.app.redis.set(key, token, 'EX', 60 * 60 * 24);
     return { key };