|
@@ -29,7 +29,7 @@ class UserService extends CrudService {
|
|
const pas = await this.createJwtPwd(data.passwd);
|
|
const pas = await this.createJwtPwd(data.passwd);
|
|
newdata.passwd = pas;
|
|
newdata.passwd = pas;
|
|
let result = {};
|
|
let result = {};
|
|
- if (data.type === '0' || data.type === '1') {
|
|
|
|
|
|
+ if (data.type === '0' || data.type === '1' || data.type === '4') {
|
|
result = await this.smodel.create(data);
|
|
result = await this.smodel.create(data);
|
|
}
|
|
}
|
|
if (data.type === '2') {
|
|
if (data.type === '2') {
|
|
@@ -53,7 +53,7 @@ class UserService extends CrudService {
|
|
user.role_id = role_id;
|
|
user.role_id = role_id;
|
|
}
|
|
}
|
|
if (name) {
|
|
if (name) {
|
|
- if (user.type === '0' || user.type === '1') {
|
|
|
|
|
|
+ if (user.type === '0' || user.type === '1' || user.type === '4') {
|
|
const staff = await this.smodel.findById(user.userid);
|
|
const staff = await this.smodel.findById(user.userid);
|
|
staff.name = name;
|
|
staff.name = name;
|
|
await staff.save();
|
|
await staff.save();
|
|
@@ -68,7 +68,7 @@ class UserService extends CrudService {
|
|
if (phone) {
|
|
if (phone) {
|
|
const _user = await this.model.find({ phone });
|
|
const _user = await this.model.find({ phone });
|
|
if (_.isEqual(_user.length, 0) || (_.isEqual(_user.length, 1) && _.isEqual(_user[0].id, user.id))) {
|
|
if (_.isEqual(_user.length, 0) || (_.isEqual(_user.length, 1) && _.isEqual(_user[0].id, user.id))) {
|
|
- if (user.type === '0' || user.type === '1') {
|
|
|
|
|
|
+ if (user.type === '0' || user.type === '1' || user.type === '4') {
|
|
const staff = await this.smodel.findById(user.userid);
|
|
const staff = await this.smodel.findById(user.userid);
|
|
staff.phone = phone;
|
|
staff.phone = phone;
|
|
await staff.save();
|
|
await staff.save();
|