|
@@ -86,11 +86,11 @@ class OrganizationService extends CrudService {
|
|
|
/**
|
|
|
* 登陆
|
|
|
* @param {Object} params 登陆信息
|
|
|
- * @property institution_code 手机号
|
|
|
+ * @property phone 手机号
|
|
|
* @property password 密码
|
|
|
- */
|
|
|
- async login({ institution_code, password }) {
|
|
|
- const object = await this.model.findOne({ institution_code, isdel: '0' }, '+password');
|
|
|
+ */phone
|
|
|
+ async login({ phone, password }) {
|
|
|
+ const object = await this.model.findOne({ phone, isdel: '0' }, '+password');
|
|
|
if (!object) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到用户的信息');
|
|
|
const { password: op, status } = object;
|
|
|
const { secret } = op;
|
|
@@ -100,18 +100,18 @@ class OrganizationService extends CrudService {
|
|
|
const { secret: secrets } = this.config.jwt;
|
|
|
const token = jwt.sign(data, secrets);
|
|
|
// 记录登陆
|
|
|
- let number = (await this.redis.get('login_number')) || 0;
|
|
|
- number++;
|
|
|
- await this.redis.set('login_number', number);
|
|
|
+ // let number = (await this.redis.get('login_number')) || 0;
|
|
|
+ // number++;
|
|
|
+ // await this.redis.set('login_number', number);
|
|
|
return token;
|
|
|
}
|
|
|
|
|
|
- async delete({ id }) {
|
|
|
- const object = await this.model.findById(id);
|
|
|
- if (!object) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到用户的信息');
|
|
|
- object.isdel = '1';
|
|
|
- await object.save();
|
|
|
- }
|
|
|
+ // async delete({ id }) {
|
|
|
+ // const object = await this.model.findById(id);
|
|
|
+ // if (!object) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到用户的信息');
|
|
|
+ // object.isdel = '1';
|
|
|
+ // await object.save();
|
|
|
+ // }
|
|
|
/**
|
|
|
* 用手机号获取企业列表
|
|
|
* @param {Object} query phone:电话号
|