|
@@ -108,11 +108,11 @@ class LoginService extends CrudService {
|
|
|
}
|
|
|
|
|
|
// 创建登录Token
|
|
|
- async createJwt(user) {
|
|
|
- // const { secret, expiresIn = '1d', issuer = role } = this.config.jwt;
|
|
|
- // const subject = phone;
|
|
|
- // const res = { uid: id, userid: uid, name, phone, role, menus, openid, remark, deptid, deptname, pid, code };
|
|
|
- const token = await jwt.sign(user);
|
|
|
+ async createJwt({ id, adminuser, uid, phone, role, remark, deptid, pid, code }) {
|
|
|
+ const { secret, expiresIn = '1d', issuer = role } = this.config.jwt;
|
|
|
+ const subject = phone;
|
|
|
+ const res = { uid: id, userid: uid, adminuser, phone, role, remark, deptid, pid, code };
|
|
|
+ const token = await jwt.sign(res, secret, { expiresIn, issuer, subject });
|
|
|
return token;
|
|
|
}
|
|
|
|