liuyu před 5 roky
rodič
revize
34577b3d15
1 změnil soubory, kde provedl 2 přidání a 4 odebrání
  1. 2 4
      app/service/login.js

+ 2 - 4
app/service/login.js

@@ -56,10 +56,8 @@ class LoginService extends CrudService {
       _userid = uid.toString();
       res = await this.stuModel.findById(_userid);
     }
-    res.userid = _userid;
-    res.openid = openid;
-    res.type = type;
-    const token = await jwt.sign(...res, secret, { expiresIn, issuer, subject });
+    const newdata = { userid: _userid, ...res, openid, type };
+    const token = await jwt.sign(newdata, secret, { expiresIn, issuer, subject });
     return token;
   }