lrf402788946 4 anos atrás
pai
commit
696bef7a3f
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      app/service/achieve_expert.js

+ 3 - 1
app/service/achieve_expert.js

@@ -43,8 +43,10 @@ class Achieve_expertService extends CrudService {
     const { password: op } = expert;
     const { secret } = op;
     if (secret !== password) throw new BusinessError(ErrorCode.BAD_PASSWORD, '密码错误');
-    const data = _.omit(JSON.parse(JSON.stringify(expert)), [ 'meta', 'password', '__v', 'verify' ]);
+    const data = _.omit(JSON.parse(JSON.stringify(expert)), [ 'expert_name', 'meta', 'password', '__v', 'verify' ]);
     const { secret: secrets } = this.config.jwt;
+    data.name = _.get(expert, 'expert_name');
+    data.role = '3';
     const token = jwt.sign(data, secrets);
     return token;
   }