|
@@ -24,7 +24,20 @@ class UserService extends CrudService {
|
|
|
}
|
|
|
const newdata = data;
|
|
|
newdata.password = { secret: password };
|
|
|
- return await this.model.create(newdata);
|
|
|
+ const res = await this.model.create(newdata);
|
|
|
+ if (res) {
|
|
|
+ const url = this.ctx.app.config.axios.auth.baseUrl;
|
|
|
+ const newdata = { name, phone: data.phone, passwd: password, uid: res.id, role: data.role };
|
|
|
+ await this.ctx.curl(url, {
|
|
|
+ method: 'post',
|
|
|
+ headers: {
|
|
|
+ 'content-type': 'application/json',
|
|
|
+ },
|
|
|
+ dataType: 'json',
|
|
|
+ data: JSON.stringify(newdata),
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return res;
|
|
|
}
|
|
|
|
|
|
async update({ id }, data) {
|