Explorar o código

修改登录bug

liuyu %!s(int64=5) %!d(string=hai) anos
pai
achega
34577b3d15
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  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;
   }