|
@@ -182,10 +182,21 @@ class UserService extends CrudService {
|
|
async delete({ id }) {
|
|
async delete({ id }) {
|
|
const res = await this.model.update({ _id: ObjectId(id) }, { isdel: '1' });
|
|
const res = await this.model.update({ _id: ObjectId(id) }, { isdel: '1' });
|
|
if (res) {
|
|
if (res) {
|
|
- // const arr = await Product.update({ userid: id }, { isdel: '1' });
|
|
|
|
- // if (arr) {
|
|
|
|
- // return arr;
|
|
|
|
- // }
|
|
|
|
|
|
+ const { config } = this.app;
|
|
|
|
+ if (!config) throw new BusinessError(ErrorCode.SERVICE_FAULT, '系统错误,需要检查系统项目设置');
|
|
|
|
+ const { project } = config;
|
|
|
|
+ if (!project) throw new BusinessError(ErrorCode.SERVICE_FAULT, '系统错误,需要检查系统中各项目的设置');
|
|
|
|
+ const { market } = project;
|
|
|
|
+ if (!market) throw new BusinessError(ErrorCode.SERVICE_FAULT, '系统错误,需要检查系统项目中项目设置的各项目配置');
|
|
|
|
+ const url = `${market}/product/userdelete`;
|
|
|
|
+ const r = await this.ctx.curl(url, {
|
|
|
|
+ method: 'post',
|
|
|
|
+ headers: {
|
|
|
|
+ 'content-type': 'application/json',
|
|
|
|
+ },
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ data: JSON.stringify(id),
|
|
|
|
+ });
|
|
}
|
|
}
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|