明树Git Lab

Commit aa087116 authored by zfp1's avatar zfp1

2

parent b3538b68
Pipeline #105977 passed with stage
in 3 seconds
......@@ -49,7 +49,7 @@ async function updateResource(req, res, next) {
if (!(ress && ress.id)) {
return res.sendError(errorMessage.resourceNotFound)
}
await DB.ResourcesInfo.destory({ where: { resourceId: ress.id } });
await DB.ResourcesInfo.destroy({ where: { resourceId: ress.id } });
if (req.body.type == 1) {
let ris = [];
for (let index = 0; index < req.body.resourceInfos.length; index++) {
......@@ -230,7 +230,7 @@ async function saveAllResourceInfo(req, res, next) {
}
}
if (toKeep.length) {
await DB.ResourcesInfo.destory({
await DB.ResourcesInfo.destroy({
where: { [Op.nin]: toKeep }
})
}
......
......@@ -65,7 +65,7 @@ async function deleteRole(req, res, next) {
// }
const ret = await DB.Role.update({ del: 1 }, { where: { id: req.body.id } });
//删除用户角色绑定
await DB.UserRole.destory({where: {roleId: req.body.id}});
await DB.UserRole.destroy({where: {roleId: req.body.id}});
return res.sendData(ret);
} catch (error) {
next(error);
......
......@@ -343,11 +343,11 @@ async function deleteUser(req, res, next) {
}
const ret = await DB.User.update({ del: 1 }, { where: search });//删除标记
//删除用户与角色绑定
await DB.UserRole.destory({where: {userId: req.body.id}});
await DB.UserRole.destroy({where: {userId: req.body.id}});
//删除用户与部门绑定
await DB.UserDepart.destory({where: {userId: req.body.id}});
await DB.UserDepart.destroy({where: {userId: req.body.id}});
//删除用户与岗位绑定
await DB.UserPosition.destory({where: {userId: req.body.id}});
await DB.UserPosition.destroy({where: {userId: req.body.id}});
return res.sendData(ret);
} catch (error) {
next(error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment