增加test用户不允许删除分类

This commit is contained in:
luchenqun 2018-03-16 11:48:58 +08:00
parent eb005395ec
commit 01a190a444
2 changed files with 8 additions and 1 deletions

View File

@ -344,7 +344,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
getTags({});
}
} else {
toastr.error('[ ' + tagName + ' ]分类删除失败!', "提示");
toastr.error('[ ' + tagName + ' ]分类删除失败!' + data.msg, "提示");
getTags({});
}
})

View File

@ -995,6 +995,13 @@ api.post('/updateTagsIndex', function(req, res) {
api.post('/delTag', function(req, res) {
console.log("delTag username = ", req.session.username);
if(req.session.username === "test") {
res.json({
retCode: 100,
msg: "test用户不允许删除分类",
})
return;
}
if (!req.session.user) {
res.send(401);
return;